Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity destroy object when out of screen

 //INSIDE ON YOUR OBJECT'S SCRIPT
 
 void OnBecameInvisible() {

        Destroy (this.gameObject);
    
    }
 
PREVIOUS NEXT
Tagged: #unity #destroy #object #screen
ADD COMMENT
Topic
Name
6+5 =