My rotation is not the same in inspector as it is in the scirpt
So i get this idk why.
the only code for this is:
public float rotationY;
void Update()
{
rotationY = this.transform.rotation.y;
}
Please help i really need this
(also the object is not parented to anything)
This is because Inspector/Transform shows you a local position, local euler angles and local scale - respectively.
transform.rotation
property houses a Quaternion
hence the strange values you were reading there (100% expected).
TL;DR:
rotationY = this.transform.localEulerAngles.y;
ps: używaj przycisku do edycji postów, bo inaczej będą usuwane, albo ignorowane, przez brak czytelności przekazu jak samej i formy posta (formatowania tekstu i kodu).
Your answer
Follow this Question
Related Questions
Rotating game object 1 Answer
Rotating an Object (To Face Another Object) Only on X and Y Axis 3 Answers
rotate an object with HTC Vive controller 0 Answers
Cant stop object/ridgidbody from rotating 2 Answers
Rotation is broken 2 Answers