- Home /
UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform).x is this good for use to my game?
Hi, I'm try to get exact reading of Inspector but can't get it. I'm reading forums but they also don't have clear solution. and I found this. but I need to know
myAngleX = UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform).x
using this may cause any problems or performance issues.
We're going to need a little more context for this. What are you using this for exactly? Or, rather, what are you looking to use this for that other options don't seem to support?
Also, if you mean that you would want to use it in a build of your game... well, you can't.
It's derived from UnityEditor, which isn't available in a build.
Answer by Bhanuka_Dassanayake · Sep 25, 2021 at 06:37 AM
I'm making Plane Controller based on PID system. And i need to get my planes orientation in oder to feed my PID controller. It was working until i doing flip. When I turn it doing weird. So i debug it, and i found that my Pitch,Roll, Yaw readings correct but only for -90° to 90° only,
I used myAngleX = transform.LocalEulerAngle.x;
but when plane roll/pitch/yaw further ±90° it' getting small again. ( -90 < 0 i know, i mean Abs of the Value ).
I mean for 180°, it shows 0° again, for 100° it shows 80°, same for (-) angles.
It only getting bigger as i expect until 90° further more it decreasing. I really need 0 to 180° values. So Please give tell me any solution to get that.
Thank You!