the system can be used along w rootmotionanimator control, right? can it be mixed w rootM animations? switching animator runtime can be done, i?
you say IK is used, so already there’s an animator. does it execute in lateupdate, or custom? (could be there a hack if controller could switch update/lateupdate)
The intent is for character movement to be controlled at any given point in time by either the procedural/IK-based system or a conventional, imported animation with blending at runtime as you transition from one system to the other.
The procedural system does make use of UnityEngine.Animator as that is what enables all the IK stuff (e.g., receiving OnAnimatorIK(int layerIndex). As it turns out, it also makes use of LateUpdate() for controlling spine and arm rotation.
Yes. There are classes (Effectors or “Affectors”) for positioning and rotation of extremities (feet). There are corresponding effectors that control body position and rotation. The trick is to keep those two things (e.g., body and feet) in sync, to be able to position the feet wrt the body, and to have parameterization to allow variable speeds, stride lengths, exact foot “plant” points, body pitch (during acceleration), body roll, etc.
Basically, everything is done either within OnAnimatorIK() or LateUpdate().
Hi Tigger,
This is something I’m trying to learn to implement into my game. Do you think it could be done with Unity’s Animation Rigging preview package? Also, how did you procedurally animate the running so it looks like the character has momentum and does not look robotic?
I looked briefly at the Animation Rigging Preview documentation. I’m sure there’s stuff in there that would be useful (e.g., constraints) but I didn’t see anything that would replace code I’d already written. When it’s GA I’ll have to take another look.
As far as momentum goes, when running at least, I guess the key is to make sure the character continues to move downwards a bit after the leading foot plants, then springs upward at the start of the next stride. The spine “rocking” slightly forward/backward helps as well.