Im trying to make a function that runs every time there’s nothing colliding with the box. Basically, when something is not colliding, I’m going to spawn something, and then thats going to leave the boxes area, and then itll spawn another one.
Use a bool. Set the bool to true with OnCollisionEnter, and to false with OnCollisionExit. Call it something like ‘isColliding.’
Then, check in your update function: if (!isColliding) { do my fancy code }. That will ensure your code is called every frame that it isn’t colliding.