Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: nFighter on August 19, 2017, 01:42:48 PM
-
Looks like a simple question, but I stuck. How can I get the local rotation of the object like it is shown in the inspector? For example it rotates from -10 to 10, how can I just get this numbers, instead of all this eulerquaternionstuff
(https://snag.gy/RIUwBQ.jpg)
-
Hi,
"Get Rotation" action?
Btw.
You should try to avoid using get/set property.
if you can't find certain action, there is a big list of actions on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) :)
-
Is get/set property so bad?
But even with Get Rotation I can't obtain this result :-\
(https://snag.gy/4mAN1c.jpg)
-
Hi,
i think you need to set 'Space' to "world"
-
No way. "world" showing me the rotation relatively to the world, so it's inherit all the rotations from the parent objects and show 0..360 angle relatively world x-axis.
Self mode is correct, but it can't give me -10 value (like it shown in the inspector), instead giving me 350.
And it's very frustrating, because I can't simply remap value (-10..10) in one action. It's jumping from the 0 to 360 and back.
-
I actually had this same problem a bunch of months back (was working a small VR game). Let me take a look into it again now that my C# is a bit better.
-
Great, thanks! Looking forward to see your results!
I wonder, is it really not a common task, so there is no common solution out of the box? ???
-
So, as I understand, basically people use solution like:
if (x > 180) x -= 360;
Isn't it weird? I see the negative values right in the inspector with my eyes, why can't I just get it directly like it shown? :o
And obviously I can't make it in one FSM state and need to make a networks of checks and transitions?
-
OK, I made my own action for negative values of local rotation. If someone else need it - here it is
https://www.dropbox.com/s/9zoeion5oh8m700/GetNegativeRotation.cs?dl=0 (https://www.dropbox.com/s/9zoeion5oh8m700/GetNegativeRotation.cs?dl=0)
-
No way. "world" showing me the rotation relatively to the world, so it's inherit all the rotations from the parent objects and show 0..360 angle relatively world x-axis.
Self mode is correct, but it can't give me -10 value (like it shown in the inspector), instead giving me 350.
And it's very frustrating, because I can't simply remap value (-10..10) in one action. It's jumping from the 0 to 360 and back.
Sorry, i did not check properly. (was working on 3 project @ the same time)
-
Hi,
yes, the Transform component inspector is processing the euler angles, so getting the exacty same values means fiddling around. 350 is the right value, -10 is a processed value and it's not available form the transform rotation directly.
Bye,
Jean
-
Hi,
I just put that action on the Ecosystem for convenience.
Bye,
Jean