Download

Root motion problem with CATrig

Hi everyone. I’m actually pretty desperated to find a solution to this.
I have this character I rigged with CAT. Then I added a single bone at 0,0,0 with no rotation as the root bone and linked the Pelvis bone to it so the Root is the parent of all the other bones.
In my opinion that should be enough, but clearly it isn’t, because I made a quick animation of the character moving forward and then played the animation with root motion enabled but he just stays in place.
Is there any guide or advice anyone can give me on this matter? Seriously, I’ve been at this for 3 days straight and nothing.

Thanks in advance for the answers.

Kinda depends on exactly what you did, but the basics of root motion is simple enough. What you need is pretty much what you did, a root bone on 0,0,0 with your skeleton linked to it so root is parent to the whole thing. When you animate, you need to have the root bone move where you want the character to move. Generally it will be following the pelvis on X and Y, sliding along the floor. Ultimately what it does in engine is the character moves and the root drags the capsule along for the ride.

When you check your animation in UE4, inside Persona, with root motion “off” you should see your character move forward and when it loops it will reset back to zero and loop like that. but when you switch root motion “on” you will see him stay in place doing the animation. This means that your root motion is working. this is what you want to see. So now only when you use the animation with root motion on your pawn, it should move forward based on the root animation.

With regards to CAT and simply hooking up a root bone, I’m not 100% sure if that gives the correct behavior, but I don’t think it’ll be a problem. Just make sure it’s rigged so that your root bone follows the pelvis on X and Y and probably make it not act like a “bone” otherwise I think it could have some weird effect on CAT when you animate. But again, not 100% sure about this, I’d need to do it to see the results.

I get the kind of behaviour you describe, but when I try to take into practice, the character just stays in place and I’m pretty sure it is indeed playing the montage with that animation.
Is there any way I can get the root motion vector extracted from the root bone to make sure if it’s extracting root motion from it or not?

Here an example showing what it looks like at the end of the animation:

&stc=1

No root enabled.

&stc=1

Root enabled.

That looks right, from what I can tell in a screen shot. Do you have root motion mode set in your animation blueprint?. I think it should be by default, at least should be set for montage by default, but maybe check that.

Otherwise I guess maybe describe more what you’re doing, maybe there’s another reason for it not working.

Okay, this is what I did to test it out:

In my Anim Blueprint I set the slot to be used (I read it’s necessary)

&stc=1

Then inside the Anim Blueprint I created a custom function to run the Rootmotion anim I created so I can call it later.

&stc=1

Then inside my character I cast to my anim instance to run the “Root Test” function to play the animation.

&stc=1

Also, I set “Root Motion from Everything” inside my Anim Blueprint. (Is there even a reason to choose “Root Motion from Montages only”?)
I think I have everything set up correctly…

Ok, yeah, I’m really not sure here what’s going wrong for you. Because everything looks ok, unless I can tinker with it myself, I’m not sure if I can track down the problem. I guess, are you sure the animation plays when you press the button?. I don’t mean judging by the PrintString, but actually, are you sure the animation plays?. The reason I ask is because it looks like your animation just shift forward and if the animation did not play you won’t know it, unless I am wrong and the pose changes. So it might seem like root motion did not work when in fact the animation did not play… you know?.

That would be my first test from here, make sure that animation is playing when you call it. Maybe export it with some big pose change in there.

The thing about root motion is, it’s not a chore to set it up, it really is just like flipping a switch. So my theory is there must be another problem. considering, I read it correctly from the screen shots, which can also be a variable here. I did not see any of this for myself, in real time, so I can make some wrong assumptions here. But I think it should be imported correctly, and if that’s the case, it should basically just work when you have it switched on.

YES! I got it working! Not exactly the way I wanted, but it works. I was reimporting the new mesh (with new bone hierarchy) over the new one and that seems like it was the main problem. Now it works like a charm.
Thanks for your patience. :smiley: I wish there was some rating system to give you points or something, haha.