-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior when setting negative scale in KinematicBody2D #24663
Comments
Please describe "strange behavior" more in detail. (Maybe with a video/GIF, https://github.com/phw/peek) |
|
I think this code sample is not the problem's source. (At least didn't find anything yet) |
Here's a simpler example. Perhaps this is documented behavior KinematicBody2D (I have not tested other objects). The screenshots show that once the Scale.x < 0, then x and y change their sign. Godot version: OS including version: Mono version: msbuilde version: |
I don't think we're supposed to set negative scale, ever. |
I still think it's weird that the Sprite for negative scale is supported, and for KinematicBody2D no. And when you set the scale in the editor, the body flips, but the scale remains positive in the code. But why scale negative only if scale.x < 0, by y the scale changes and remains the same? The examples actually change the scale of the sprites. My mistake. I apologize if this is really the correct KinematicBody2D behavior |
@Zireael07: partially true. |
|
Related: #5734 |
@VAVUS7 yes, that's intended.
That's probably not going to change soon. So: Don't scale physics bodies. |
But the effect of manual scaling remains. And it is confusing. And again, why only with scale. x <0? Physical synchronization in KinematicBody simply sets the scale to 1, 1. |
Godot version:
3.1-4a mono
OS/device including version:
Linux Mint 19.1
Issue description:
You try to set the scale.x < 0 for KinematicBody2D, RigidBody2D, and (possibly) StaticBody2D from code, scale changes sign to opposite (-1, 1) -> (1, -1); (-1, -1) -> (1, 1). In this case, the scale actually changes, but the resulting scale is not correct.
In the attached project in _Ready, we change the original scale (1, 1) to (-1, -1). The body changes its scale, but the scale in _physics_process is now (1, 1).
Minimal reproduction project:
KinematicScale.zip
The text was updated successfully, but these errors were encountered: