playMaker

Author Topic: Navmesh path check?  (Read 1777 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Navmesh path check?
« on: January 18, 2017, 08:04:35 AM »
Hi, I am using navmesh for my enemy AI but there's some problems that I dont understand.

I put my player as the enemy's agent destination and if the player is out of the range of the blue navigation area, the enemy will stop chasing but there's no good action to check if the destination path is out of range..

I tried using actions like 'path is stale', 'check path status' and other ones but none of them is working as I thought to be.

Am I missing some key knowledge on using navmesh?
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Navmesh path check?
« Reply #1 on: January 18, 2017, 10:24:24 AM »
Maybe you can check distance and if more than X, stop chasing.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Navmesh path check?
« Reply #2 on: January 18, 2017, 10:46:36 AM »
try setting the player as the destination, waiting like 0.1 and then use check path status

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: Navmesh path check?
« Reply #3 on: January 19, 2017, 12:38:27 AM »
Wait for 0.1 and using path status > 'Path undefined event' works for checking if the destination is outside the blue navigation.

Thanks..
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio