I’m using the AniMate package to create animations for my rigid bodies, but I am encountering a problem whereby all of the rotation commands are trying to move towards a global value, not a local value how I want them to.
I used the following code to create an arm that swings to the left and right with the keypresses “a” and “d” respectively:
if (Input.GetKeyDown ("a"))
Ani.Mate.To(transform, 0.5, {"rotation":
Quaternion.Euler(50,0,0), "drive": Ani.Drive.Slerp});
if (Input.GetKeyDown ("d"))
Ani.Mate.To(transform, 0.5, {"rotation":
Quaternion.Euler(-50,0,0), "drive": Ani.Drive.Slerp});
The result is not what I want however. If the basecube of the arm topples over to the side then I noticed that the movements of the arm are trying to pull it towards a global X rotation instead of relative to it’s joint to the basecube.
Is there a solution?