Answered

jump and rotate 45 in the air

kloogens 12 months ago updated by Peter - Soxware Developer 12 months ago 3

I completed the tutorial where you fix the jump animation.

I removed the forward motion from the animation so the character jumps straight up and down.

All I want to do is rotate the character 45 degrees while in the air around the Y-axis.

While that sounds easy, I've spent all day trying to get it right and I can't no matter what combination I try.

 The rotation influences the Z and X axis as well (not in the inspector though it works as expected rotating on global y).   I can be in Euler rotation, quaternion progressive, local, global, absolute, or relative, it doesn't matter the output is always the same, the character rocks back and forth on both the x and z axis after it lands until it settles back down into the same pose as the first frame.

I have no idea what is going on.

Please help.



UMotion Version:
1.29
Unity Version:
2022.1.23f

Answer

Answer
Answered

Hi kloogens,

thank you very much for your support request.

In order to rotate a character around the y axis make sure that your "Pivot Mode" in the Pose Editor is set to "Global". Then select the hips bone and rotate it using the green circle of the rotation gizmo. If you want your character to turn from e.g. frame 5 to frame 10 make sure that you have a key with the initial rotation at frame 5 and a key with the final 45° rotation at frame 10. Remove any rotation keys of the hips bone that are in between.


Please let me know in case you have any follow-up questions.


Best regards,
Peter

Answer
Answered

Hi kloogens,

thank you very much for your support request.

In order to rotate a character around the y axis make sure that your "Pivot Mode" in the Pose Editor is set to "Global". Then select the hips bone and rotate it using the green circle of the rotation gizmo. If you want your character to turn from e.g. frame 5 to frame 10 make sure that you have a key with the initial rotation at frame 5 and a key with the final 45° rotation at frame 10. Remove any rotation keys of the hips bone that are in between.


Please let me know in case you have any follow-up questions.


Best regards,
Peter

Thanks for the reply.

That was pretty much the first thing I tried, but for some reason that created the problem in the first place.

One thing I failed to make clear.  The hip already has minor rotations keyed into its animation.

So when I would do what you suggested, (I think) the X and Z rotation caused the rocking motion and the end of the jump when the character landed. And since this motion was coming from the hips the whole animation was messed up. Not to mention the Z and Y axis looked suspiciously similar when I looked at the curves.  GimbleLock perhaps?

However, late last night I found an easy solution I somehow overlooked.

Just want to make sure this is the right way.

Here is what I did.

Found the start of the jump where I wanted to start the rotating.  Created a key for hips rotation on the base layer.

Found and moved to the keyframe where I wanted the rotation to be complete. 

Then I just selected the hips and used the UMotion rotation tool to rotate the Y-axis in relative mode to 45 degrees and key its rotation.

Then adjust the keys in between using the rotation tool in relative mode as necessary.

When you want to maintain those "minor rotations" that are already keyed into the animation, you could also use an additive layer to add the 45° rotation offset on top.

You can do this by creating a new animation layer of type "additive". Select the additive animation layer and then perform the same steps as mentioned before: If you want your character to turn from e.g. frame 5 to frame 10 make sure that you have a key with the initial rotation at frame 5 and a key with the final 45° rotation at frame 10.

UMotion Manual - Layers: https://www.soxware.com/umotion-manual/Layers.html

Regarding Gimbal Lock: This can indeed be an issue. If Gimbal Lock is causing issues, try to change rotation mode to something quaternion based.

Please let me know in case you need any further help.

Best regards,
Peter