Complete the code to declare a public integer variable named score.
public class GameStats : MonoBehaviour { public [1] score; }
The keyword int declares an integer variable in C#.
Complete the code to make the variable health visible and editable in the Unity Inspector.
public class Player : MonoBehaviour { [[1]] private int health = 100; }
The [SerializeField] attribute makes private variables visible in the Inspector.
Fix the error in the code to correctly serialize a Vector3 position variable.
public class Enemy : MonoBehaviour { [SerializeField] private [1] position; }
Vector3 is the correct type for 3D positions in Unity.
Fill both blanks to declare a public string variable named playerName and initialize it to "Guest".
public class User : MonoBehaviour { public [1] playerName = [2]; }
Use string for text variables and enclose text in double quotes.
Fill all three blanks to serialize a private float speed variable with initial value 5.5f.
public class Vehicle : MonoBehaviour { [[1]] private [2] speed = [3]; }
Use [SerializeField] to show private variables, float for decimal numbers, and add f suffix for floats.