Why Everything in Unity is a GameObject
📖 Scenario: You are creating a simple Unity scene where you will understand why everything in Unity is a GameObject. Imagine you want to build a small game world with objects like a player, a tree, and a light source.
🎯 Goal: Build a Unity script that creates three GameObject instances: a player, a tree, and a light. You will add simple components to each to see how Unity uses GameObject as the base for everything.
📋 What You'll Learn
Create three
GameObject variables named player, tree, and lightSource.Assign each variable a new
GameObject with the exact names: "Player", "Tree", and "LightSource".Add a
Rigidbody component to the player GameObject.Add a
Light component to the lightSource GameObject.💡 Why This Matters
🌍 Real World
GameObjects are the foundation of all objects in Unity games and apps, from characters to lights to cameras.
💼 Career
Understanding GameObjects is essential for Unity developers to build and organize game scenes effectively.
Progress0 / 4 steps