Help with Finding Object Rotation

Hi All,

I’m knew to Unity and i’m currently creating my own aircraft controller.

What i need to be able to do is get the current angle of the z rotation of the object and and place it in a var to allow me to constrain it at certain points through an if statement.

I can get it through EulerAngles but as you know i can’t use this in my if statement.

Any help would be much appreciated as i’m on a tight deadline for the project.

Thanks,
Gordon

explain why you cant use it in your if statement.

Did another test. Had been associating the transform.localEulerAngles instead of transform.localEulerAngles.z in the var so wasn’t working.

Got access to the value.

Thanks