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 ?

asked Aug 23, 2019 in Projects by Vrzasq (178 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

answered Aug 23, 2019 by johnygames (1,574 points)
selected Aug 24, 2019 by Vrzasq

Aye but that way I need to redo my collision shape. Seems like bug to me, issue raised
https://github.com/godotengine/godot/issues/31622

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.