Hi!
I am trying to create a parallax style effect for a rotating object. So I’m trying to calculate the angle between the previous rotation (before the update call) and the current rotation (in update) of a specific axis so that I can then rotate all the other objects accordingly (at a faster or slower pace than the current object). However I am running into trouble doing that.
I am able to get the absolute angle using Quaternion.Angle(), but it always gives me a positive number instead of giving me the actual angle with direction. I also tried eularAngles but that always brings up a positive number as well.
Is there a simple way to know the angle of rotation of an object on a specific axis (with the number sign)? For example, if I rotate my object on the Y axis from 10 degrees to 90 degrees, I will calculate that it rotated 80 degrees. If I rotate it from 60 degrees to 20 degrees, I will calculate that it rotated -40 degrees. Of course I want to get all this information from the object itself from a variable that I store before and after the update call.
My goal is to use this number to for a transform.Rotate(x,y,z) call.
Thanks for reading.
Yaniv
Sorry but I found my answer at unity answers. I can’t delete so I’m posting this for others to see in the future: