Why does rotating behave weirdly when model is at 90 degree angle?

2024-12-20 11-33-32
When I try to rotate object in inspector and its not at n*pi angle it behaves weirdly.
It’s like it rotates around pivot but pivot doesn’t follow the model and rotations don’t care about axes.
I don’t know what’s going on and I’m genuinely confused.
It doesn’t seem like problem is in the sword model because it’s the same with just a cube.

This is called gimbal lock.

The simplest and quickest way to deal with this is by having a hierarchy of transforms, one for each axis: one for roll, one for pitch, one for yaw… if you roll/pitch/yaw a sword the way you would an airplane. :slight_smile:

Notes on clamping rotations and NOT using .eulerAngles because of gimbal lock:

How to instantly see gimbal lock for yourself:

All about Euler angles and rotations, by StarManta:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html

Quaternion dumper if you absolutely insist on peeking inside the ugly parts:

Thank you, gimbal lock master : D