playMaker

Author Topic: Navmesh agent, root motion and rotation  (Read 1604 times)

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Navmesh agent, root motion and rotation
« on: February 05, 2022, 07:18:27 AM »
Hello! Maybe somebody knows how to make Navmesh agent who's using root motion for moving forward, but using rotation from navmesh agent rotation data?

I've seen tutorials how to do this in full root motion with 2d blend tree with animations that have rotation, but I only have forward moving animations.

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Navmesh agent, root motion and rotation
« Reply #1 on: February 06, 2022, 05:20:22 AM »
With some help I managed to solve this, for anyone looking into the same thing - there is an action "Set Agent Update Rotation", which you can set to false, then:
- Get Agent Steering Target, to get the point where agent is moving;
- Control agent rotation with "Smooth Look At" to the Steering Target;

And there goes your much smoother than default Navmesh agent movement with root motion, no more sliding legs :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Navmesh agent, root motion and rotation
« Reply #2 on: February 06, 2022, 08:35:36 AM »
Hi.
Thanks for sharing your solution!