Respawning a prefab which has been, Destroy(This);

Hello! I’ve been crying to myself and on my pillow for a couple of hours now and decided I would take help from some better coders. So! Let’s dive right in it.

I’ve got one script which adds one value (key), it destroys the object and adds an image on the screen, everyone happy, but! I later got a collider taking in all the keys for storage, im now trying to make the prefab (key) to spawn again freshly, keep in mind I’ve got a script allowing it to spawn at random cordinates at startup I dont know if this works in runtime.

If anyone could help me with this simple script I cant figure out myself that would be wonderful. And also! If any misspellings were made during this post, it is very late here and I didnt sleep last night so pardon me <3.

You can spawn it in runtime like at startup, with GameObject.Instantiate(yourprefab);

1 Like

Thank you very much! I just figured it out because of you!