playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete? (Read 3737 times)
k00k
Playmaker Newbie
Posts: 3
NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
on:
September 09, 2016, 02:49:19 PM »
I'm successfully using "Set Agent Destination As Game Object" from the NavMeshAgent actions to move an object (AI model) to a waypoint (Destination game object).
How can I determine when it reaches that destination so I can trigger FINISHED?
Logged
terri
Sr. Member
Posts: 386
Re: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
Reply #1 on:
September 09, 2016, 06:56:56 PM »
If you use
Get Agent Remaining Distance
there is an "arrived" event
Logged
k00k
Playmaker Newbie
Posts: 3
Re: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
Reply #2 on:
September 09, 2016, 07:42:20 PM »
Yes, I found that and I set "Arrived Event" to FINISHED. However, when I hit play, it finishes instantly. So _agent.remainingDistance==0 (this is the condition that this script checks) is happening right away for some reason.
Logged
k00k
Playmaker Newbie
Posts: 3
Re: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
Reply #3 on:
September 09, 2016, 07:56:38 PM »
I updated the condition that I mentioned and it now works. See my gist:
https://gist.github.com/k00k/404ca85b8c56587786327066d003aaec#file-getagentremainingdistance-cs-L75-L76
Logged
terri
Sr. Member
Posts: 386
Re: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
Reply #4 on:
September 13, 2016, 04:43:19 PM »
Cool, I tested it and had the same problem, your solution works well!
Logged
Gua
Beta Group
Sr. Member
Posts: 309
Re: NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?
«
Reply #5 on:
October 29, 2020, 08:10:55 PM »
Link no longer works
Logged
http://vintsevych.com
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
NavMeshAgent: Determine if Set Agent Destination As Game Object is complete?