Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fat Pug Studio on January 18, 2020, 04:26:17 PM
-
Hi guys,
I'm doing some 3D for the first time, though i'm doing well there's something i can't figure out. I have an object that's not parented to anything and has rotation 0, 0, -15 set via transform in the inspector.
However, when i use Get Rotation to get its rotation i get something like -270, 0, 0. I tried self world, eulers, quaternions, tons of other actions, delaying the start and so on but i still can't get it the way it is displayed.
Any advice?
-
Hi guys,
I'm doing some 3D for the first time, though i'm doing well there's something i can't figure out. I have an object that's not parented to anything and has rotation 0, 0, -15 set via transform in the inspector.
However, when i use Get Rotation to get its rotation i get something like -270, 0, 0. I tried self world, eulers, quaternions, tons of other actions, delaying the start and so on but i still can't get it the way it is displayed.
Any advice?
Just for debug sake, what if you try doing a Set Rotation before you Get Rotation? See if they match. Also while you do it, note position it rotates to and see if anything can be figured out from that too.
-
I tried setting the rotation then getting it.
When using euler angles instead of 0, -20, -90 i get -5.12243e-05, 340, 270.
-
For example, two red cubes are rotated the same
(https://i.postimg.cc/13rghLQP/screenshot-14.png)
But one has 0, 0, -50 rotation, other has 140, 90, 90.
Whatever i choose, quaternion, euler, x, y, z, i can only get it right via gizmo. It's like it's missing one more axis.
(https://i.postimg.cc/KzR4Tjgv/screenshot-15.png)
The only thing is that the object that should rotate is scaled differently, it is elomgated to 2 via x. How to take that into account? Maybe get the direction?
-
Hi,
can you show the two red cubes at an angle on the scene view with their respective transform tripod axis?
Bye,
Jean
-
Hi Jean,
sorry for being a bit late. What'a s tripod axis?
(https://i.imgur.com/kNae01W.png)
(https://i.imgur.com/AjGBEqZ.png)
-
Hi,
this will explain it: https://forum.unity.com/threads/solved-how-to-get-rotation-value-that-is-in-the-inspector.460310/
basically, they tweaked the values shown to look nice....
the transform tripod axis is the blue,red green axis showing either the local transform reference system of the global reference system of a transform. It certainly has a better name... but that's how I call it :)
Bye,
Jean
-
Hi,
ok, in that post, they had some code snippet and it seems to work so I made an action for it: GetTransformRotationInspectorEuler
(https://i.imgur.com/2UEwhLw.png)
Let me know how it goes.
Bye,
Jean
-
Works fine, cheers Jean, you're the best :)