Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Add patrol to a navmesh script

Discussion in 'Editor & General Support' started by undyingwill, Mar 20, 2017.

  1. undyingwill

    undyingwill

    Joined:
    Feb 3, 2016
    Posts:
    92
    Hello, i have baked navmesh, enemy with navmesh agent script that detects player from certain distance and follow it.
    If enemy doesn't see player = stay on one place

    When add patrol script with waypoints, so enemy partol with these waypoints when he doesn't see player, (but when navmesh agent script is ON), the enemy doesn't use partol waypoints and again just stays.

    What i have to add to the navmesh agent script, so it knows about patrolling script? (First Patrol, if player is in range - use navmesh script, when player is out of range - use again patrol.