Script won't work on duplicates/prefab copies until I delete Unity meta files
I have a few scripts in order to pool, spawn, and fire 3D spheres that act as bullets for my game. However, when I try to copy (either with duplicate or by making a prefab) more than one enemy (because a game with one enemy would probably be boring) it will not fire any shots. However, if I copy/paste my enemy gameobject, save and close Unity, and delete all the meta files inside my Assets folder; the enemies will fire and work as intended upon opening the project again. This method does not work with prefabs, they will continue to not fire upon reopening the project.
The error Unity throws me says "Object reference not set to an instance of an object." However, I do not understand how some enemies (and the player) can still continue to call this same method successfully, when others cannot. They share the same script where the error occurs. Any help with this would be greatly appreciated.
Your answer
Follow this Question
Related Questions
How to affect only one object out of many objects with the same name using script? 0 Answers
Duplicates of prefab appearing out of nowhere 0 Answers
Destroying an instance of a prefab not working 0 Answers
Instantiate a prefab and access sub-mesh material 0 Answers
Prefabs Making Unity Slow? 0 Answers