instantiate and delete trouble with my NPC
Hello, I am new to unity and C# and have a question. I have one character called player. if I click anywhere on the map, it moves to that location. Along with that, I have three other NPC. One which has a tag labeled red follows a ball on the map. One which has the tag blue, moves randomly throughout the map. One called yellow, which follows the player. I then have two tiles on the map. One that spawns the NPC and one that deletes NPC. my issue is with the delete. If a character goes over the delete tile then it is deleted. but then I then move over the spawner and Unity throws an error. It is essentially saying the game object is missing. I did some research and found that I am supposed to first intiate a prefab of the original and then delete that. I have been working on this for a while and still no luck. I was wondering if someone could help explain how this should be done. I am using a trigger and a tag so that when the NPC touches it, it can be destroyed.
Your answer
Follow this Question
Related Questions
Changing rotation of prefab 0 Answers
Saving Instantiated objects,Saving Instantiated objects 0 Answers
All instantiated objects having same location, 0 Answers
Find instantiated prefab by name 3 Answers
Arrows fire in reverse. 1 Answer