unity remove gameobject
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
unity remove gameobject
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
unity destroy gameobject
// Destroy this gameobject
Destroy(gameObject);
// Kills the game object in 5 seconds
Destroy(gameObject, 5);
// Removes this script instance from the game object
Destroy(this);
// Removes the rigidbody from the game object
Destroy(GetComponent<Rigidbody>());
how to destroy a gameobject in c#
Destroy(gameObject); // destroys the game object attached to the script
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us