Hi folks, I’ve got a common issue with what appears to be a hidden solution. I’ve got a game with tons of finished mo-cap animations for our characters and enemies. Many of these animations (transitional animations mostly…aka, the animations that play from one loop to another like idle to aggressive) shift the actual character off of the origin.
So when I play, for instance, the character’s idle animation and then play the transition from idle to aggressive, he shifts off of the origin a bit (rotations, of course, end at arbitrary values also). If I then followed with an aggressive idle animation (gun up), he’ll pop back to the local origin of the blank object above the rig in the hierarchy and animate from there. I obviously need to avoid that.
The only way I really see this being feasible is to have a root game object that the rest of the hierarchy is a child of. That game object sits between the characters feet and moves with him within the animation but is always on that floor plane between his feet (or, depending on the animation, an equivalent location). When one of these transitional animations is done, I take that root and zero him out so his position/orientation is 0,0,0.
The next time an animation plays (for instance the aggressive idle), the rest of the rig would still be correct relative to the parent, and the parent (being this floor plane root) will now start (first frame of that animation has the root at the origin of the scene) at the correct position, avoiding any popping.
I can only do this once that transitional animation has finished so I know the this floor plane root won’t get animated off the center, thus causing a pop in the animation.
Does all of this make sense? My characters’ animations move/rotate them in world space and when I play the next animation, I need them “back at the origin” so it plays correctly relative to their new location/orientation.
Any help would be immensely appreciated, I don’t have a ton of time on this one.
-Matt