x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Root Motion snap back

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.

Product Version: Not Selected
Tags:
more ▼

asked Jan 24 '18 at 08:54 PM in Blueprint Scripting

avatar image

dsenter
35 3 6 8

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Jan 24 '18 at 09:00 PM

avatar image

Jin_VE
4.3k 31 75 40

avatar image dsenter Jan 24 '18 at 09:15 PM

Thats a good idea, I will try out the notify to move the actor and see if that works!

avatar image Jin_VE Jan 24 '18 at 09:53 PM

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.

avatar image Jin_VE Jan 24 '18 at 10:32 PM

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).

avatar image dsenter Jan 24 '18 at 11:16 PM

This did the trick, thanks for the help all!

avatar image Jin_VE Jan 24 '18 at 11:46 PM

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.

avatar image xlar8or Jan 24 '18 at 11:19 PM

Good to know :)

(comments are locked)
10|2000 characters needed characters left

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.

more ▼

answered Jan 24 '18 at 09:00 PM

avatar image

xlar8or
5.9k 152 126 300

(comments are locked)
10|2000 characters needed characters left

What is the best solution then for animations that do not have root motion?

more ▼

answered Jan 24 '18 at 09:35 PM

avatar image

dsenter
35 3 6 8

avatar image xlar8or Jan 24 '18 at 09:48 PM

The correct way is to add translation / rotation to the root bone using a DCC program like maya and 3d studio max.

avatar image dsenter Jan 24 '18 at 10:08 PM

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) https://docs.unrealengine.com/latest/INT/Engine/Animation/AnimHowTo/LayerEditing/index.html

avatar image xlar8or Jan 24 '18 at 10:14 PM

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 Jin's suggestion to set the actor location at the end of the animation?

avatar image dsenter Jan 24 '18 at 10:19 PM

I did try Jin'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.

avatar image Jin_VE Jan 24 '18 at 10:28 PM

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.

avatar image xlar8or Jan 24 '18 at 10:34 PM

What Jin said.

avatar image razmaz51 4 days ago

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

avatar image xlar8or 4 days ago

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.

avatar image razmaz51 3 days ago

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.

avatar image razmaz51 3 days ago

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?

avatar image razmaz51 3 days ago

when I use " process root animation" he moves along the floor til he rolls off the edge , with a red line getting longer behind him. This means the animation has root motion right?

avatar image xlar8or 3 days ago

Yes, the red line indicates the root motion movement.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question