Download

Is Root motion working with you guys for Actor Class??

Hi I want to know if anyone is able to get Root motion working with actor Class.

It’s been unsuccessful so far, I have read that its not fully supported, sometimes it randomly works half way and doesn’t look correct other times it doesn’t work at all.

Is this feature supported yet?

Wellll lets just say root motion is not “fully” supported depending on what it is that you are trying to do.

First I’ve never used a pawn class as to the need to have an active character that needs to move as to knowing the difference between the two.

The character BP is more or less the same as the pawn class except it contains a movement component which creates a bounding box or capsule. Using in-place animation it’s the capsule that is used that allows the player to move in world space and the animation only reacts to the current state of the capsule like a puppet in a box. The capsule also supplies three key functions of collision as well as gravity as well as the required replicated information as to where the player is located in world space during network play

To use root motion you still need to make use of the character BP rather than the pawn and in the animation BP tell the movement component that root motion is being used. This will more or less glue the capsule to the character providing both gravity and collision. The need for collision is obvious but in all cases the player should always be in a state of falling so that it can find the ground using collision to detect when the player is on the ground.

A bit of info as to the difference between in-place and root motion is in-place is reactive where RM is event driven, a QT event if you will, and contains all of the necessary data as to the purpose of having the character move based on being referenced to ground and not world space as to the behavior of the movement component.

Could you use a pawn class and not a character?

Short answer yes you could but then you would have to provided the necessary functions provided by the movement component which as a guess adds at least half of the requirements and becomes even more problematic if you have a network requirement. Using a pawn class one would have to expect strange behavior in a non-typical configuration and I have to ask why you want to use a pawn instead of a character class?

Thanks for the feedback, I am aware of most of what you wrote, however here’s my situation/questions:

1 - I don’t intend to use the PAWN class for any player controlled activity, they are being used for enemies only.

2 - I need root motion on dozens and dozens (sometimes over 40) enemies at the same time in the view all performing a predetermined and pre-made animation or action sequences (some of them even instanced many dozens of times). Using character BP has been killing off performance more than necessary. PAWN seems to work much better but couldn’t get Root motion to work properly, it seemed too random.

3 - All i need on these enemy units is Root motion support and collision capsule. Don’t need the extra stuff that Character BP comes with (which i suspect are causing the unnecessary performance losses when multiplied by that many enemies on screen). And don’t let the relatively large number put you off, the scene is well optimized and arcade like, the performance only hits hard when character BP comes into play on all of them.

4 - Don’t care about any networking issues as it will not be part of the project.

Some of these units need to follow a predetermined path while being spawned as instances, I tried horrible time consuming workarounds, by importing the animation path or spline on its own (through some weird math at first since UE doesn’t allow you to simply import splines from 3d apps) and trying to match XYZ of the PAWN class Capsule to follow the trajectory meanwhile animating everything else in place (technically acting like root motion) but its a very long process in a pipeline and not ideal as there are many types of enemy units. I don’t want to draw splines for every one of these units to follow, I just need the already animated object to simple spawn and do its thing.

Should i put in a request for this? Can we have a PAWN class that can have Root motion even if it needs to bring in some of the character BP functionality in. For those who don’t need to use it can simply ignore but for those of us who do it’s a big deal to not have it in there.

Creating a custom PAWN class is something I haven’t looked into yet and i’m not sure if i need to dig into the source code which wouldn’t be a task for me personally.

Any pointers?

Humm interesting project. With out hands on we are talking theory as I’ve yet to see any proof of concept as to how RM would function under these conditions and this is the kind of stuff I’m always on the look out for. As of this date though there is not even a sample project available that makes use of RM in place of in-place so if you get something working pleeeaaasssee follow up. :wink:

As for can it be done and still maintain performance

https://www.youtube.com/watch?v=CLFgs-172jg

40 V 40 says a lot as to setting a bench mark of what I assumed is in place but might be worth reaching out to Drix Studio for guidance Getting the player moving though should be more or less the same except converting from reactive animation to event driven.

Another consideration is functions usually used with in-place do not really work with root motion so if your using a basic controller design will give you strange results. Jumping in RM for example is totally different than using in-place.

Awesome RM motion matching system.

https://www.youtube.com/watch?v=qBbCjuJpE9o&t=36s

Since RM is 100% data driven one could more or less plug in any kind of controller they wish including an AI driver.

I think that Filmstorm is a merchant on the Epic market place so you could also reach out to them.

Another resource to check out is the shooter example which already has a functional bot system so you could use it as a sandbox to test theory on a design that already works.

But based on experience is not always in the framework but what the design inherits as to what has been applied that effects drawcalls (huge performance vampire) using a character model that has way to many material ID’s not suitable for the purpose. Toss in the fact the actor needs to be dynamically light there is really no way to save performance past x max.

Just a thought.

As to a possible reason as to random result I found the use of state machines to be unpredictable as the blending state has to be set to get out of the state as a percentage. where motion matching can figure out where it has to go and how to get there with in the event graph.

Bottom line if the animation has to wait, as it does using in-place it could mess up the animation action being provided already via the RM (Kind of like stepping on the break at the same time you stomp on the gas :wink: )

Awesome premier of using RM the proper way :wink:

https://www.youtube.com/watch?v=KSTn3ePDt50

Thanks for the info Frankie, The RM matching video is interesting, isn’t this similar or same as what Epic did with paragon motion warping?
And yes the 40 vs 40 sample above seems to be simple “in place” mode animations.

But I guess this doesn’t solve much of my problem.

I think I will go ahead and post a Feature request soon in the hopes that Epic implements a Pawn root motion class. (what are your thoughts?)

You know I hate to nag on problems because i believe in solutions, but I wont rule out nagging on the basics, If you don’t have water you can’t make a dam.

Coming from unity this root motion was never a problem, why can’t Epic just fix these issues before they move on to other matters. Sometimes things like these are surprising.

  • In my project I wasn’t even using state machine for the enemies but rather simple predetermined paths while they are being spawned as instances. As you can see even such a simple matter was proving problematic.

Well you could bring it up to Epic but they already know :wink:

Predetermined paths do not work for the same reason state machines won’t work in that root motion already provides the necessary data and the road to success is to ignore all things that needs to be done as to using in-place animation. I was able to get root motion to work by tossing out the state machine and instead used a simple logic tree and multiplexed the keyboard input.

Why RM does not work with state machines is because the state machine requires that the current state has to exit when the state changes “but” also has to wait X amount of time until there is enough frames left in the animation to blend on the exit into the next state with in the sequences of events.It works using in-place because the speed and direction of the movement component is a constant no matter what happens in the state machine as the animation is reactive. Since movement is contained as part of the data set forcing it to wait more or less tells the forward movement to continue so you would get a strange result.

Using a tree the RM animation blend enters from the beginning and uses a weight value and not a wait state so no need for exit arguments. Binding to a path will not work as well as once again speed, location, and rotation is contained with in the animation so for it to work you would need a gimble that generates the data for the RM to follow. Long way to say that since RM is data drive it needs some type of input to work and not bound or dependent on a movement element like a movement component or path.

The thing is all of the parts are there it’s just once again the lack of documentation as to implementation that is lacking

What would be of great help is a RM version of the Shooter example :wink:

we found this from a post which has a similar problem:

https://forums.unrealengine.com/deve…rom-characters

But it means to temper with the source code and compile things…

Will give it a try perhaps.

Its totally fine to have the animation blend from one root to another and take its time especially when its enemy units in this case, because then it will be like having the intended predetermined animated sequences which is exactly what we want. So it doesn’t have to be super responsive to player actions, it just has to look right in terms of animations as well as reduce extra workarounds. should just spawn and move in space exactly as it was animated in the 3d app as a blueprint.

I’ve been browsing around and it seems that this problem comes up everywhere and people have been asking for it since 2016!

We tried the code, wont work, crashes UE…

I’m not sure if there are documentations out there to help create custom classes with root motion?

I also posted in the feedback section, not that i’m counting on it that much…

Can always slap on a sphere/capsule collider and replace the root, and add a floating movement component and get creative

I looked into it, unfortunately it’ not what i’m looking for, I need the root data from an already animated object, plug an play just like in character class, Also the title of this thread should’ve been “actor and pawn class” more so the simple actor class as that’s what i need to use with root motion.

I’ve asked nearly everywhere but no one has bothered to reply yet, I’m surprised this hasn’t come up more, it seems everyone just uses character class actor for all root motions, but this is needlessly resource intensive with almost 80% of its features being unused in case of AI or custom opponents.

Was hoping someone would point to a custom C++ root motion component creation to apply in the actor class. maybe that’s the way to go?