rotate_local_z reset #12179
-
I'm trying to tilt the ship slightly when turning left and right. But as soon a the ship point towards the bottom of the screen it flips completely even though I have added the -current_z to the roll. I don't understand why this is happening. I'm still learning bevy. 2024-02-28.17-39-25.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I hope this helps :) |
Beta Was this translation helpful? Give feedback.
-
Thanks, your suggestion helped but now I get this other issue where the asset just completely flips 180 facing down. 2024-02-28.23-02-37.mp4Also is there a better way to reset the rotate_local_z value to default? |
Beta Was this translation helpful? Give feedback.
transform.rotation.z
is not the rotation around the Z axis.To get the current rotation around Z you need
transform.rotation.to_euler(EulerRot::XYZ).2
.I hope this helps :)