I am currently making a simple side-scroller. In unity. I am looking for a way to spawn objects before they enter camera, and remove them after they have passed the camera. All this will happn in the x axis.
There are 6 different kinds of objects that are going to be spawned. and with different distence from each other. The objects can be picked up, and they are all prefabs and have the functional scripts for pickup if the player collide. But I need a way to remove them if they didn't get picked up.
Is there anyone that have a simple script where this will be possible?