+1 vote

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)

in Engine by (16 points)

1 Answer

+3 votes
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.

by (21,940 points)
selected by

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.