Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Placing original objects off a navmesh???

Discussion in 'Navigation' started by EnsurdFrndship, May 16, 2015.

  1. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Hello,
    I am trying to write a game where I have multiple characters spawning at random points using the Instantiate function while using Unity's pathfinding system on each instantiated object. The problem I am having with this is, whatever happens to the original object, when that object gets Instantiated, the copies of that object have the same things happen to them, so when I blow up the original object by shooting at it, and other objects get Instantiated FROM the original object, those objects ALSO have been, 'gunned down' as well.

    To work around the problem, I had the game place the original object (who's name has an IndexOf of -1 at finding the string, "Clone") at Vector3 position -10000, -10000, -10000, and made it invulnerable (where the script 'explode' is disabled on that object) so that the objects that spawn from it will be based on the original (that always stands), but I noticed that I can't place the original object at Vector3 position -10000, -10000, -10000 because for some reason, once an object that is placed on a NavMesh before runtime, it always STAYS on the NavMesh, so I have the original (invulnerable) object in the game weather I like it or not. How do I turn on and off pathfinding on an object or set the objects up so that they can fall off the platforms that they are on, be placed on and off the platforms later in the game, or be originally placed off the Navmesh without giving any errors? I tried using GetComponent<NavMeshAgent>().enabled and it doesn't work.
     
  2. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Another words, how do I have my objects that use pathfinding get placed from one 'grid' to another or, on no 'grid' at all without any errors? So far, Unity's pathfinding System does not allow objects to fall outside of their navigation system grid(S), and REQUIRES that each object gets placed near a grid before runtime. How can I have my pathfinding objects alternate grids during the game?
     
  3. EnsurdFrndship

    EnsurdFrndship

    Joined:
    Apr 17, 2010
    Posts:
    786
    Hello? Also, is it possible to do 3D pathfinding (for objects in the air)? So far, I try to move the objects off the Navmesh in my scene, and I can't, so what I was asking earlier is if there is a way to turn on and off that constraint.
     
    Last edited: May 20, 2015