Hey there, the root motion information comes from the animation itself. If it doesn’t have root motion, then there is nothing you can do, unless you can edit the animation in maya or 3ds to add the root motion. What you suggested is a bit of an hack, but it might work if you compensate the snapping in the end.
Hello, I have an animation I bought from the UE4 Marketplace. Some of the animations do not have root motion, the character simply stays in place when (based on the animation) the character should move. For example, the animation is of the character getting hit and stepping backwards a few steps, but they stay in one place.
I’ve tried turning on Root Motion in the animation and turned on “Process Root Motion” but nothing seems to work. To solve this, I tried creating a duplicate of the animation and animating the root bone with animation layers. However, the character then just simply snaps back into place after the animation plays.
Is there a way to solve this snapping? Or perhaps I am doing something in correctly here.
That’s ingenuity! I think it will work if you set a notify at the end of the animation (or in the ending transition rule) and when that fires, you set the actor location to the root bone location.
Thats a good idea, I will try out the notify to move the actor and see if that works!
What is the best solution then for animations that do not have root motion?
If you don’t want RootMotion for all movement (just montages works OK) then you need to move the pawn yourself. Since RootMotion-All doesn’t work for online multiplayer, I had to use animation start/end notifies to drive my own movement. That can get tricky for complex movements but all of mine are just linear so I can lerp the motion. For complex movements you’d probably want to use a timeline.
The correct way is to add translation / rotation to the root bone using a DCC program like maya and 3d studio max.
Yes, however, this animation did not come with root motion. It looks like root motion can be added with an animation layer but it doesn’t seem to work when I’ve done it: (see bottom) Editing Animation Layers | Unreal Engine Documentation
I did try 's method but found the character to sink into the floor while moving into position, then popping back up to the correct space. I would need to rewrite some of the AI for this part though and was hoping to find a more elegant solution.
The animation layers works for moving the root bone, but as I said there was popping.
That’s because the capsule’s location is above the floor. You need to add in the half-height of the capsule to the root bone position.
Since you can’t access the originals to add the root motion then the layers i think are your only chance, unless you want to do the movement manually using like a curve or timelines, but that is a bit of pain for complex translations. Have you tried 's suggestion to set the actor location at the end of the animation?
Good to know
If you had an issue trying to implement my solution, you should have said something. Capsule center is not on the floor but RootBone is, so you need to account for that by adding the capsule half-height to the RootBone location (assuming it’s exactly on the floor, you may need to subtract the radius of the root bone).
This did the trick, thanks for the help all!
Cool! And yeah, good to know. Adding a track for the root bone is a neat trick I never thought of. You might want to make sure it’s all good by making the capsule visible and ensuring it always moves smoothly with the mesh. Just in case and if you haven’t already.
i know this thread is older , but can you explain how add in the half height of the capsule to the root bone animation? I have this issue also with a roll animation. thanks
You can add that as relative location of the mesh when you are playing that animation., if you dont want to do that and know how to use a DCC software like maya or 3d studio you can edit the animation and add that offset on the animation, if not you can edit the animation itself in unreal engine and select the bone, lift it manually, hit the Key button on the top bar (which will create a curve for that selected bone) and when you are happy hit the Apply button next to the Key button.
thanks for reply, well if I make the capsule visible in game , I can see he ( the character mesh ) , rolls right out of the capsule in the animation. As though he moves , but the capsule stays put , then he snaps back to the capsule at the end of the animation.
which bone to lift , and where to lift to? If I select the root and try to lift it, it moves the whole character. Or is the root not a bone?