Answers for "Destroying object when cama does't see it unity"

C#
0

in unity i want to destroy a gameobject when it hits the edge of the screen

// this does take into account EVERY camera, including the editor view one
// but that shouldn't be a big deal once the game is built

void OnBecameInvisible() {
 	Destroy(gameObject);
}
Posted by: Guest on April-09-2020

C# Answers by Framework

Browse Popular Code Answers by Language