0 votes

I'm wanting to make a Fighter game in the Godot engine. The players move left and right.
I want to change the scale of the Sprite, whenever It walks to the left.
The reason I'm using scale and not"flip_h" is because the Sprite node is a parent node for an Area2D and CollisionShape2D node.

Is there a way to change the Sprite's scale through code?( GDscript preferably)

asked Jul 2 in Engine by Zambie135 (15 points)

1 Answer

+1 vote
Best answer

You can change the scale property:


node.scale = Vector2(1.5, 1.5)
node.scale.x = -1
node.scale.x *= -1

and so on.

answered Jul 2 by kidscancode (17,164 points)
selected Jul 2 by Zambie135

thank you very much! This is working

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.