Page 1 of 1

Deleting Prefab on load

Posted: Fri Feb 19, 2021 2:19 pm
by seaniboy2009
Hi,

Just a quick question, i have a prefab used for my quest system and when the user collects it, its then deletes it. whats the best way to do this with easy save, add a bool to delete when loaded or set up the prefab auto save to auto delete it when loaded if it was deleted and saved, if that is even a thing?

Thanks

Re: Deleting Prefab on load

Posted: Fri Feb 19, 2021 3:05 pm
by Joel
Hi there,

I've attached a sample script which you can attach to a GameObject to save whether it's been destroyed, and will destroy the object if so when loading the scene.

All the best,
Joel

Re: Deleting Prefab on load

Posted: Sat Feb 20, 2021 1:21 pm
by seaniboy2009
Works perfect thank you.