I created a simple jump animation for my character with one bone using Maya, two parameters are changing, the x parameter to move forward and Z parameter.
I put that animation inside an animation montage and enabled root motion options,the result isn’t as expected, what I get is a moving forward animation without any changing of Z values !
Is root motion locked into x-y axes ?or do I need manually to move up my character ?
This was really boggling me too! Thanks for the solution. I was even using a custom movement mode, but it does seem to have to be “flying”.
I would add to this slightly to say that, for me, UE4 seemed to ignore all translation when there was a Z component and movement mode was not flying. Rotation was applied though, regardless of movement mode.
Hey I came up with another solution to the problem that doesn’t require changing the movement mode to flying. If you’re using C++ and a custom character movement component you can simply override the UCharacterMovementComponent::ConstrainAnimRootMotionVelocity
function. As you can see, in its implementation it is preventing the Z value from being overwritten:
FVector UCharacterMovementComponent::ConstrainAnimRootMotionVelocity(const FVector& RootMotionVelocity, const FVector& CurrentVelocity) const
{
FVector Result = RootMotionVelocity;
// Do not override Velocity.Z if in falling physics, we want to keep the effect of gravity.
if (IsFalling())
{
Result.Z = CurrentVelocity.Z;
}
return Result;
}
I removed this in my override function like so and it worked great