GameObject represents an object in the scene world. On its own, a GameObject does nothing — you add Components to it to give it behaviour, appearance, and physics.
Transform
Every GameObject has a Transform that describes where it lives in the world: its position, rotation, and scale. When a GameObject has a parent, its transform is stored relative to that parent, so moving the parent moves all children automatically.Tags
Tags let you group and filter GameObjects. Physics uses them to decide which objects collide with each other. Cameras use them to include or exclude objects from rendering. You can also read them yourself in code:Tags are inherited. If a parent has a tag, all of its children have it too. To remove a tag from a child, you must remove it from the parent.
Hierarchy
GameObjects can have children, forming a hierarchy. Access a GameObject’s children throughGameObject.Children:
Creating GameObjects in the editor
In the s&box editor, right-click inside the Scene panel and choose Create GameObject to add a new empty object. You can then rename it and add components from the Inspector.Creating GameObjects in code
Create a new empty GameObject and parent it to the scene:Finding GameObjects
UseScene.Directory to look up a specific object by its GUID:
Scene.GetAll<T>() to iterate over all components of a type — this is the most efficient way to find specific objects by their components:
Destroying a GameObject
CallDestroy() on the GameObject itself, or use DestroyGameObject() from within a component: