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().enabled and it doesn’t work.