Complete the code to add a Rigidbody component to the GameObject.
gameObject.AddComponent<[1]>();The AddComponent<Rigidbody>() method adds a Rigidbody component to the GameObject.
Complete the code to remove the BoxCollider component from the GameObject.
Destroy(gameObject.GetComponent<[1]>());The GetComponent<BoxCollider>() gets the BoxCollider component, and Destroy() removes it.
Fix the error in the code to add a Light component correctly.
var light = gameObject.[1]<Light>();AddComponent<Light>() adds a Light component to the GameObject.
Fill both blanks to add a SphereCollider and then remove it from the GameObject.
var collider = gameObject.[1]<SphereCollider>(); Destroy(gameObject.[2]<SphereCollider>());
First, AddComponent<SphereCollider>() adds the component. Then, GetComponent<SphereCollider>() gets it so Destroy() can remove it.
Fill all three blanks to add a AudioSource, get it, and then destroy it.
var audio = gameObject.[1]<AudioSource>(); var getAudio = gameObject.[2]<AudioSource>(); Destroy([3]);
First, add the AudioSource with AddComponent. Then get it with GetComponent. Finally, destroy the variable getAudio which holds the component.