1
\$\begingroup\$

So I see variations of this question all over the place, but no satisfying answers, so here goes.

When using root motion to move your character in Unreal Engine the Velocity property of the Movement Component returns the velocity of the animation/root bone and not the actual velocity of the character. These two things are the same when there are no obstacles, but if the character is blocked by something and just walking in place (i.e facing a wall so he can't move forwards) the Velocity property is still returning the velocity of the animation/root bone as if it was moving through the wall unhindered, even though the actual velocity of the character is now zero.

Is there some (easy and performant) way to calculate the actual velocity of the character?

\$\endgroup\$

1 Answer 1

-1
\$\begingroup\$

in your case, i think u could use IF for colliding object, If your player (forward arrow) collide with object u could set forward velocity to 0.

\$\endgroup\$
3
  • \$\begingroup\$ What about when the player is contact with something but not fully stopped? Eg running along bumping into a wall? \$\endgroup\$
    – Basic
    Nov 10, 2022 at 10:41
  • \$\begingroup\$ So u must use teleport or sweep if it collide with object (wall could be use tag for identity) \$\endgroup\$
    – nixsnake
    Nov 11, 2022 at 11:07
  • \$\begingroup\$ I'm not the person asking the original question, I'm just highlighting one scenario where your solution would give an incorrect result. \$\endgroup\$
    – Basic
    Nov 11, 2022 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .