Creating new animation in JS

Hello,

I would like to coding of my player’s waking up after ragdoll. It means I would like to create a new animation by codes which has a starting frame (= the actual ragdoll pose of the player) and an endig frame, which is fixed, because it comes from an existing animation’s first frame (the nimation called “MP_Idle”). The animation’s planned length is ~2 seconds (50 frames).
Additionaly: during the ragdoll, the animation component is disabled until it wakes up. I use Legacy anims.

Any help would be extra greatful!

Thank you!

Rather than creating a new animation in code, I’d recommend just moving the objects in code directly (maybe in a coroutine) and leaving the animation component disabled until the code has finished its thing.

So I have to save every joint’s position and rotation and start to moving and rotating them to the proning anim’s jointpos and rot values?

I try to get the joint angles from the first frame of the prone anim, but not easy. Is there any good way?

The project file in this link may be of some use to you.

Thank you!!!