- Unity 4.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 217字
- 2025-03-31 04:01:57
Time for action – create the Ball
Let's add a built-in GameObject
to the Scene view:
- In the menu, click on GameObject.
- Point to Create Other.
- Click on Sphere.
What just happened – that's all there is to it?
Well, yeah, actually! Unity has a number of prebuilt simple 3D models, also known as primitives, which we can use to get started. You've just created a built-in game object with four components on it. A component is a piece of functionality that modifies or augments a GameObject. Look at the Inspector panel to see what the Sphere's components are:
- Transform: This determines how a game object is positioned, rotated, and scaled (made big or small) in your Scene view.
- Mesh Filter: This component takes a mesh, and runs it through the Mesh Renderer. A Mesh defines the connected vertices that comprise a 3D structure.
- Sphere Collider: This is a sphere-shaped boundary on our game object that helps Unity figure out when instances of game object colliders touch, overlap, or stop touching.
- Mesh Renderer: This component enables the player to see our meshes. Without it, meshes don't get drawn or rendered to the screen.
We'll get a better understanding of what exactly a Mesh is when we add the Paddle to the Scene a few steps from now.