Skip to content

Learning Unity

This section contains resources for learning how to work with Unity3D, a game engine for building immersive experiences, games, and more.

Note this is a living document and is constantly being updated. Some things may come and go over time.

Beginner

Development Tools

  • Unity
  • Visual Studio
  • HTC Vive

Unity Basics

  • Unity Interface
    • Navigation
    • Hierarchy
    • Windows - Scene, Game
    • Console
    • Inspector
    • Custom Layouts
    • Tools - QUERTY
  • Project / File Organization
    • Assets Folder
      • If you delete it in Unity it deletes it from the folder. Careful.
      • .meta files generated by Unity. They need to go with the source file if you move it in the explorer (windows) or finder (MacOS).
      • Make subdirectories to keep it organized
        • Ex. Scenes, Scripts, Models, Textures, Prefabs, Physical Materials, Materials
  • Adding Objects to a Scene
    • Manipulating Objects
    • Inspecting Objects
    • Nesting Objects - Parents and Children
  • Working with Game Objects
    • Adding Components
    • Rigid Body
  • Game Play
    • Init Objects, Compile Scripts, etc
    • Changing parameters in Unity before and during gameplay
  • Importing Assets
    • Import your own assets (from CAD package - Rhino, Fusion, Maya, Blender, etc)
    • Import assets from Asset store
    • Import assets you find on the web
  • Intro to scripting
    • Scripting...What is scripting?
    • What's in a script?
    • Monodevelop and Visual Studio
    • Make a GameObject
    • Make a new script and add it as a Component to your new GameObject
    • Print to the console from your script
      • Debug.Log("Hello World!!");

Unity + SteamVR

The SteamVR Plugin is an easy way to integrate VR functionality into Unity. It's recommended to import the Unity package via Asset store within Unity. Note that SteamVR won't work unless there is VR capable hardware connected (ie. HTC VIVE) and you are running the Unity project on a Windows 10 machine.

Required Software

Build a Unity project and add the SteamVR plugin

  1. Make a new Unity project. Name it "MySteamVRProject."
  2. Import plugin SteamVR from asset store
    • Search for SteamVR and click Import.
    • Click Import when prompted. A dialog comes up that shows what files will be included.It may take a moment to include everything in the package.
    • Click Accept All when prompted with the recommended project settings.
    • You will see a confirmation that says “You have made the right choice”. Click Ok.
    • Now you should see the SteamVR folder under Assets.
  3. Disable or remove the default Main Camera in the Inspector
  4. Keep the included Directional Light or add a Point Light and disable any unused lights.
  5. Add a Plane and Cube to the scene
    • Move the Cube up in the Z direction by 1 unit.
  6. Add the Player prefab found under SteamVR/InteractionSystem/Core/Prefabs. This includes the camera and controller objects.
  7. Generate the action.js file by navigating to Unity menu Window > SteamVR Input.
    • Click Yes when prompted to save a copy of the example json files.
    • Click Save and Generate on the SteamVR Input dialog.
    • Once that’s done there will be an example scene file in Assets/SteamVR/InteractionSystem/Samples/Interactions_Example.unity. Explore this scene or go back to the default SampleScene file you started with.
  8. Start adding other objects into the scene.
  9. Hit play and put on the VIVE

References

How to Add Teleportation

  1. Create an empty GameObject
  2. Locate and add the Teleporting prefab found under SteamVR/InteractionSystem/Teleport/Prefabs. 3. This is the primary object for managing teleportation functionality.
  3. Add one or more TeleportPoint game objects found under SteamVR/InteractionSystem/Teleport/Prefabs. These should be places at specific locations you would like to teleport to. Add one or more Teleport Areas
    • Create a Plane and adjust the size and location.
    • Rename the game object to TeleportArea
    • Position the plane object 0.05 units in the Y direction so it’s just above the ground plane.
    • Add the Teleport Area component
  4. Hit play and put on the VIVE

References

How to Add Object Interaction (Pickup & Throw)

  1. Add a Cube GameObject to the scene
  2. Add the Interactable component to enable interaction features such as highlighting.
  3. Add the Throwable component to be able to pick up and throw the object.

References

Intermediate

C# Scripting

Unity Scripting References

Unity Scripting Tutorials

C# References

Unity Scripts

Scripting Behavior