Only keep gameobject create on runtime while game is running

Hi there,

I’ve been looking around for this but can’t find an answer. I am creating gameobjects through a script at runtime, but once the script runs, all of the created game objects stay in the scene forever afterward, meaning that when I run the game again, they all get duplicated.

What I am trying to do is for those gameobjects to only be created when the game is running, and then disappear once stopped. Is this possible?

Thanks

My bad, my script was also running OnDrawGizmosSelected, they do disappear if run on start only. My apologies :slight_smile: