I’m trying to spawn enemy object which I made prefab of it as well. The thing is, I removed whatever is in the scene and trying to spawn using prefab on EnemyManager from Unity Survival Shooter tutorial.
The only difference between theirs and mine is that my enemy spawner requires Player object to follow and have it attached as part of script.
It does spawn, but the script(s) that are attached to it is not working at all. All it does is piling upon previously spawned objects. (script works fine with original object placed in the scene, but I want them to be keep spawning even when original is destroyed. Which is why I’m trying to use prefabs)
Whenever I try to drag and drop FPSController on the script attached to prefab object, Unity won’t allow me to do that. So I tried to prefab everything I need for chase script, but when it is spawned, like I said above, they do nothing and just sit there.
How do I spawn object with scripts attached to it and make them work (i.e. follow the player) once it is spawned using prefab?
Or, is there way to spawn object without using prefabs and still have it working even if original object is destroyed? (so not instantiate for sure)