Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to destroy object in unity c#

// To remove a GameObject attached to this script instantly
Destroy(gameObject);
// To remove a GameObject attached to this script
//in certain time (5 seconds for this example)
Destroy(gameObject,5);
 
PREVIOUS NEXT
Tagged: #destroy #object #unity
ADD COMMENT
Topic
Name
6+2 =