I have a problem understanding rotation in unity. Why is the rotation in the inspector not the same as the rotation in the code. And why Y and Z is 180*?
Debug code in Update
Debug.Log(transform.rotation.eulerAngles);
// Same thing with rigidbody
Debug.Log(_rigidbody.rotation.eulerAngles);
Inspector:
Object in hierarchy
in the inspector the local euler angles are showed, in your code it's absolute euler angle.
use localEuler angle instead if you want to get same result with inspector.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.