I just started going through the Godot docs and tutorials for 2.1 a couple weeks ago to make a 2D Platformer, and for the sake of learning I started rebuilding what I have in 3.0 with C#. I cannot figure out how to make the player's sprite flip using the new language.

in gd-script flipping a player character's sprite while moving is as simple as: if (move_left and not move_right): velocity.x = -RUN_SPEED get_node("Sprite").set_scale(Vector2(-1, 1)) #this is the line I can't convert into Csharp

What would the equivalent of that third line be in c#? I can't find any options like set_scale. I know using an IDE isn't supported yet but I'm using Monodevelop on Kubuntu if that helps.

I haven’t used C# in Godot, but I think you can do it like this?

get_node(“Sprite”).scale = Vector2(-1, 1);

I think all of the getter/setter functions have been removed in favor of accessing the properties directly. (I haven’t used Godot 3 in awhile though, so I could be completely wrong )

I tried taking what you wrote and it didnt work, BUT you got me started in the right direction. c-sharp requires a bit of setup, you can't just say get_node("Sprite").do_things. I still couldn't figure out how to use SetScale, but I figured out a simpler alternative:

	if (move_left & !move_right) {
		Sprite sprite = (Sprite)GetNode ("Sprite");  #this is the weird line
		sprite.FlipH = true; # toggle the fliph attribute built into the Sprite node
		velocity.x = -RUN_SPEED;
	}
5 years later