playMaker

Author Topic: Set Agent Destination, need Help please[SOLVED]  (Read 2230 times)

Pandur

  • Full Member
  • ***
  • Posts: 122
Set Agent Destination, need Help please[SOLVED]
« on: February 17, 2020, 03:21:35 PM »
Hello, i have start a littel Project now for testing and learning, the goal is create a simpel dungeon crawler with point and click movement.So for that is use Unity navmesh and the playmaker.

Now i have create 3 states :

State one :
Mouse Pick  (with a Store Point variabel)
Get mouse Button Down (click left mouse Button event for the next state walk)

State two (walk) :
Set aninamtor float (the Animation go to walk so is the variabel 1)
create a Object : a object will create on the Store Point Variabel (so the player can see how the Character will walk to that)
Set Agent destination (Use Owner , Store Point variabel , Path Pending Done Event is here State Three (Idle)

State three (idle)
Set animator float (the animation go to idle variabel is 0)
destroy Object (the Store Point Object will delete)

So my Problem now  :
The player start click to move to the point.
Playmaker go in State two and after 1 Second or next frame in state three so that my player will slide in the rest way in the Idle animation over the ground to point how i have clicking.
I use Unity 2019.3
« Last Edit: February 19, 2020, 07:13:43 AM by jeanfabre »

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Set Agent Destination, need Help please
« Reply #1 on: February 18, 2020, 12:05:50 AM »
Heya,

I had troubles with the exact issues for a long time until I discovered that the Path Pending Event isn't really good to rely on.  I think what happens is that it can't calculate the path quick enough and throws a false value in there (Usually Negitive value) which imminently does a false positive. 

My work around was to ignore that event on the action and use a new action "Path Pending" ( or something close to that name as I can't recall currently).  That action can check every frame to see if the path has been generated and once its done, you then check the distance left in a new state.

Let me know if that helps

Pandur

  • Full Member
  • ***
  • Posts: 122
Re: Set Agent Destination, need Help please
« Reply #2 on: February 18, 2020, 02:06:43 AM »
Thx for your answer , i have test it out but it will not work with the function Get Agent Path Pending, i have the same problem with that action like before. I have write a littel C# sharp script for moving and that works fine with no problems.On that script i use navMeshAgent.destination function and i think that problem is on playmaker.

Pandur

  • Full Member
  • ***
  • Posts: 122
Re: Set Agent Destination, need Help please
« Reply #3 on: February 18, 2020, 02:57:47 AM »
Littel Update : I have take the Function Nav Mesh Agent Move from the ecosystem,that works great for me.