Search Unity

Pushing Target off of Navmesh

Discussion in 'Navigation' started by Kevo17, Aug 19, 2016.

  1. Kevo17

    Kevo17

    Joined:
    Jul 14, 2016
    Posts:
    1
    Hi everyone,

    I've been working on a game that uses navmesh for enemy movement. The objective is to knock the moving enemies off the floating platforms, which the navmesh is applied to. I am shooting an instantiated sphere and when no navmesh is applied, the physics work and the enemies get blasted away.

    With navmesh on, the enemies get pushed by my instantiated sphere, but they never fall off.

    Is there a way I could disable the navmesh, or navmesh agent, OnCollision?
    Is this even possible, or should I not be using navmesh? I would prefer to not have to use a waypoint system.

    Thanks in advance!
     
  2. vulgerstal

    vulgerstal

    Joined:
    Jun 26, 2014
    Posts:
    9
    Set Destination of Agent to place where You want Your npc to fall, and where there's no Navigation Mesh;
    NavMeshAgent.SetDestination will return false because it will not find the way to reach that area.
    So if it returns false and player was punched - You disable NavMeshAgent and enable ragdoll.