playMaker

Author Topic: Navmesh agent and mecanim[SOLVED]  (Read 2616 times)

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Navmesh agent and mecanim[SOLVED]
« on: February 07, 2018, 08:09:38 AM »
Hi all,

I am trying to get mecanim working with a navmesh agent correctly to create appropriate walk forward/back/stafe. Similar to this https://docs.unity3d.com/Manual/nav-CouplingAnimationAndNavigation.html

Essentially I have an agent moving that I need to be able to manually aim and animate accordingly.

How would one go about generating a playmaker fsm to take variables from the current movement direction against look direction and feed into a blend tree.

I have tried agent velocity/speed. Looked at every post on the forums and cannot figure it out at all.

I am looking for mecanim to receive two variables for a blend tree.

Any help greatly appreciated.
« Last Edit: February 19, 2018, 02:26:48 AM by jeanfabre »

Digitom

  • Junior Playmaker
  • **
  • Posts: 61
Re: Navmesh agent and mecanim
« Reply #1 on: February 07, 2018, 02:48:59 PM »
You could try playing around with inverseTransform direction

https://docs.unity3d.com/ScriptReference/Transform.InverseTransformDirection.html

Use it to calculate the velocity movement versus the transform of the agent...in theory you should receive if the agent is strafing left or right ...Vector.right or Vector.left in local space.

you could plug that into float variables and send those variables to the animator.

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Navmesh agent and mecanim
« Reply #2 on: February 18, 2018, 09:41:19 AM »
Thank you! Can mark resolved, took some fiddling but this was the root action to fix the issues.