playMaker

Author Topic: "Get Agent Velocity" is always getting a value, even when still  (Read 935 times)

EpicMcDude

  • Playmaker Newbie
  • *
  • Posts: 45
I'm trying to setup an animation float parameter with the Agent Velocity, so that if the agent moves than a Run animation will play.


The problem is that the Get Agent Velocity action always returns a value, it's almost never 0 as if the Agent is always moving when he is just standing still.
This also happens with the Get Game Object Speed, where the Speed float always registers a value even when the game object is still.

This causes the animation float parameter to trigger the run animation, so the Player character is constantly jittering with the run animation when standing still.

Is there a way to fix this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: "Get Agent Velocity" is always getting a value, even when still
« Reply #1 on: July 10, 2021, 07:24:24 AM »
Hi.
in the animator transitions look for a velocity greater than 0.1 instead of 0 for example

EpicMcDude

  • Playmaker Newbie
  • *
  • Posts: 45
Re: "Get Agent Velocity" is always getting a value, even when still
« Reply #2 on: July 10, 2021, 09:02:14 AM »
Hi.
in the animator transitions look for a velocity greater than 0.1 instead of 0 for example

Hey Dino! I actually have the transition as high as 7, I noticed that anything below 5 gets registered more often.
BUT, there were a couple of times where I've seen it spike to 28 when the object is standing still, which is the maximum magnitude registered with the Get Agent Velocity...

Am I out of luck? I'm not sure how to make it not register the velocity...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: "Get Agent Velocity" is always getting a value, even when still
« Reply #3 on: July 10, 2021, 10:32:15 AM »
Hi.
Not sure why the Agent velocity is doing this.(I never used it yet)
But maybe you can make some sort of checker when player is near
to the click point that it set a animator bool for idle.

You can do this on a separate fsm. just use set fsm vector 3 after mouse pick.
Use Get position and And Get Distance Between 2 Vectors for example.
And the have a float compare to see if closer than or further.
Depending on that you can set an animator bool.