I don’t know for sure, but you probably need to change
directionOfMotion = GetTree().GetCurrentScene().GetNode<KinematicBody2D>(“Player”)
to
directionOfMotion = GetTree().GetCurrentScene().GetNode<KinematicBody2D>(“Player”).previousSpriteState
Though thinking about it, you probably can only access variables within the class you have retrieved. Since KinematicBody2D doesn’t have the previousSpriteState variable, you might need to use:
directionOfMotion = GetTree().GetCurrentScene().GetNode<Player>(“Player”).previousSpriteState
instead, since the Player class has the previousSpriteState variable defined.
This Reddit thread, seems to have useful information on accessing variables in Godot through C#, which might be helpful.
Side note: I have experience with Godot, but not really with the C# integration in Godot.
Hopefully this helps! :smile: