Using Unity
Last updated
Last updated
This page goes over the basics of the Unity interface and the parts of a Unity workshops. For a more detailed tutorial on using Unity use the resources at https://learn.unity.com which has extensive documentation and tutorials available.
Every Unity project has at least one scene. A scene contains all the elements a player/user would interact with at a time. You might create different scenes for different levels of your game or for menus or start views for your application.
The default scene starts out with some basic items: a cube, a camera and a light.
There are four main areas of the Unity Interface.
This window at the center of the interface show you a 3D view of your scene. This isn't necessarily the view a player would see when playing but can be adjusted to any angle that is convenient to manipulate the elements of your scene in 3D space.
When you run your Unity project players see a view from the perspective of the camera included in your scene.
This is a text list version of what can be found in the 3D view. This hierarchy shows only items that our actually in your scene and how they relate to each other. This is a good place to look if you want to select a specific item in your scene.
This panel on the right, lets you manipulate properties of items in your scene. This can be there position, color etc. as well as what scripts are attached to them or other modifiers.
The assets panel is where you might store various items your project might need. This could be 3D models, images, sounds files or scripts. These items are NOT in your scene yet just part of your project.
The most basic element of a Unity scene is the game object. Game objects can include:
3D models
Images
Lights
Cameras
Objects to hold scripts
Objects to hold sounds
Triggers and colliders for reacting to events
Prefabs are special template game objects you can use to make your game more efficient and easier to manage. These objects are basically clones of a single game object that can be reused. Any object that doesn't need to change but you need to make multiple copies of is a good candidate for a prefab.
When you modify a prefab all instances of it also change.
The assets area includes any of the raw elements of your project. This can include, Prefabs, 3D models, scripts, textures, images, sounds or other media. Items in your assets are like a library from which you can work from. They aren't part of your scene until you add them to the hierarchy. Unity automatically organizes where these asset files live in your project folder, and will recognized updates to the files from outside of Unity.
Unity uses C# as its primary scripting language. Scripts can be attached to any game object to add additional functionality. Most scripts will be derivatives of the MonoBehavior class. This class lets you hook into Unity's event loop which controls when various parts of a game are updated and rendered to the screen.
The script below extends the MonoBehaviour class to add features for a Bowling ball object.
It implements two different methods Start and Update which are triggered at different parts of the event loop.
One of the best ways to learn Unity is to use their own tutorials and resources:
To learn how to set up a Virtual Reality project in Unity 3D you can follow our walkthrough: