Complete the code to declare a basic GameObject in Unity.
GameObject [1] = new GameObject();The variable name player is used to store the new GameObject instance.
Complete the code to add a Rigidbody component to a GameObject.
Rigidbody rb = [1].AddComponent<Rigidbody>();The player GameObject is the one to which we add the Rigidbody component.
Fix the error in the Update method to move the GameObject forward.
void Update() {
transform.Translate(Vector3.[1] * Time.deltaTime);
}Using Vector3.forward moves the object forward in the scene.
Fill both blanks to create a dictionary mapping GameObject names to their components.
Dictionary<string, [1]> components = new Dictionary<string, [2]>();
The dictionary maps strings (names) to Component objects, so both blanks use 'Component'.
Fill all three blanks to filter and store active GameObjects with Rigidbody components.
var activeRigidbodies = [1].Where(go => go.[2] && go.GetComponent<[3]>() != null).ToList();
We filter gameObjects that are activeSelf and have a Rigidbody component.
