Have problem on Instantiate a new GameObject

Hello,
I have a problem on spawning Lizard as child of each Spawner. What I mean is… that it actually spawns correctly, but when the cactus hits with the zucchini and destroy a Lizard the prefab on the spawner gets destroied too and stops the spawning of new lizards. But not only in one spawner… the prefab is missing on them all. So I tried to comment the Destroy function on the Projectile.cs script, but seems like nothing changed… I also tried to remove the Instantiate as a child, to see if maybe it had worked again but unfortunatly it didn’t. So pls help me :slight_smile:

This is the error i get:
https://gyazo.com/0aaa2ac7bd671f98eba6e745c0dde7ed

Hope i was clear on the message.
Byeeee

I can’t access the link, can I see the code in question? And what game objects are involved and how do they relate to each other?

You have to excuse me, but it magically solved… I closed Unity and re-opened it and i redid the same things i’ve seen in the video lesson and now it works… i really can’t explain that lol. Anyway thank you for your help maybe was something i missed to do :wink:

This magical behaviour is not uncommon in Unity. For this reason, it’s usually a good idea to restart Unity when issues occur which do not make sense (at once).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms