evileye
0
Q:

unity3d remove component

Destroy(GetComponent<TheComponentYouWantToDestroy>());
7
Destroy (gameObject);
6
 // Kills the game object   
Destroy (gameObject);     
// Removes this script instance from the game object     
Destroy (this);     
// Removes the rigidbody from the game object    
Destroy (rigidbody);         
// Kills the game object in 5 seconds after loading the object    
Destroy (gameObject, 5);     
// When the user presses Ctrl, it will remove the script      
// named FooScript from the game object     
function Update () {        
  if (Input.GetButton ("Fire1") && GetComponent (FooScript))
    Destroy (GetComponent (FooScript));     
}
0

New to Communities?

Join the community