Making root motion play nice with detour

Hello!

I’ve been experimenting a bit with root motion animations (I got the Kubold pack from the asset store so I could play around a bit), and set it up so I can issue orders to a detour pathfollowing component.
I then drive the movement of the character using root motion animations along the PathFollowingComponent->GetCurrentDirection() vector.

Let’s just say I’ve had varied results. :smiley:

The problem seems to be that this direction vector gets quite messed up when the root motion is not following what I assumed is the pathcomponents preplanned path exactly, and it “spazzes out”.

Has anyone else attempted to accomplish this with good results?

I would really like to get this working with root motion since it looks so much natural than the in-place versions, but if this is a fundamental problem that will be hard to solve without extensive modifications, then I suppose I will have to settle with using inplace animations and dynamically changing the max speed of the characters to try to sync it up with the animations best I can…?

I’m very novice when it comes to animations, so if there is some easy obvious way I’m completely missing, then please tell me :slight_smile:

Here is some info on my setup:
I’m running the ABP subclassed from a custom AnimInstance class I’ve written. I’m doing all calculations in the cpp, only driving the states and animation poses in the ABP.
Basically, the ABP state rules are driven from properties on my custom base class, and every time I enter a new state I have an animation notification that updates the state of the base class so I only ever tick on relevant properties.

My state machine looks like this:

Where all the states except idle are acting upon blendspaces that make sense for my graph.

Best regards,
Temaran

One solution that I’ve tried is to essentially use root motion animations for the start/stop/sharp turn, and use in-place animations while running. This would prevent the vector from spazzing out, but I can’t seem to get the ABP to blend from a rootanimation to a non-root animation. It “jerks” in the transition whenever I try this.

/Temaran

Okay!

I had an idea and managed to track the spazzing vectors to some odd bug where my navmesh wasn’t rebuilding dynamically properly!
I fixed it by forcing rebuilds.

/Temaran