0 votes

I have an issue with rigibody2d when transform scale x is set to -1. It flip my sprite upside down.

The demo scene is setup as show on the picture below:
enter image description here

Basically left unicorn is duplicated version of right unicorn with rigidbody2d scale x set to -1. When I play the scene the left unicorn if flipped.
enter image description here

Is that a expected behavior or there is something I don't get with an engine ?
Or it is a bug and I should post it on:
https://github.com/godotengine/godot/issues ?

in Engine by (183 points)

What version of Godot are you using? In Godot 3.1 those work as expected. Maybe it is a bug after all.

I use version 3.1.1. It happens also when I wrap rigidbody2d with node2d and change x scale on that. When I flip sprite only i does not flip collision shape, example on picture

enter image description here

1 Answer

0 votes
Best answer

I think I figured it out. I do not know why it's doing that, but I know how you can avoid the issue. You should not be using the Scale method of the RigidBody. Use the sprite's Scale method instead. It will work as expected. By the way, is that... is that horn... what I think it is? XD

by (1,887 points)
selected by

Aye but that way I need to redo my collision shape. Seems like bug to me, issue raised

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.