Unity Cheat Sheet
Basics
- (X, Y, Z) = (right, up, forward) (left-handed)
- There is no “default unit”, but…
- Physics system constants assume 1 unit = 1 meter
- Model building apps vary in scale. To be sure:
- Create a 1x1x1 meter cube in your modeling software
- Import the cube into Unity
- Create a second cube inside Unity (GameObject > 3D Object > Cube) (default size is 1x1x1 meter)
- Verify the two cubes are the same size.
- Project Settings -> Editor -> Enter Play Mode Settings / When entering Play Mode -> Do not reload Domain or Scene
Scene View
` to show the overlay pop-up
~ to show/hide all overlays
- middle-button pan
- ⌥-left-button rotate around center of screen
- right-button rotate around viewpoint (and wasd)
- ⌥-right-button zoom in and out
- f center on currently selected object
- shift-F lock the view on currently selected object
- cmd-shift-F align selected object with current editor view
- cmd-shift-option-F align editor view with selected object
- Show/hide gizmos:

Hierarchy
- drag object tree to Project to create prefab
Inspector
- right-click on “Transform” to reset
GameObject
- Every
GameObject has:
- A
transform component
- A
tag
- An active flag: read it with
activeSelf, set it with SetActive(bool). When false, object doesn’t appear, and colliders and scripts don’t run.
activeInHierarchy tells you whether it’s actually active in the scene: it’s false if the object or any of its parents is inactive.
MonoBehaviour
Start() and Update()
[SerializeField]
Time.deltaTime
OnCollisionEnter(Collision other)
GetComponent<Type>()
Time.time
Destroy(gameObject); // Destroy(this) will destroy the script!
float xValue = Input.GetAxis("Horizontal")
using UnityEngine.InputSystem
- Create serialized
InputAction variables
- Add bindings for each
InputAction
- Enable each
InputAction
- Use the value of the
InputAction for gameplay
- Disable each
InputAction if/when we need to turn off input
Keyboard
Keyboard.current.cKey.isPressed
Keyboard.current.cKey.wasPressedThisFrame
Physics
- Override
FixedUpdate() for fixed time update callbacks for simulation
- Multiply by
Time.fixedDeltaTime to scale changes to timeslice
rb.AddRelativeForce(force * Time.fixedDeltaTime * Vector3.up);
Cinemachine
- Install from Package Manager (Unity Registry)
- Right-click on hierarchy, and choose Cinemachine
Audio
AudioClip
AudioSource
AudioListener
if (!_audioSource.isPlaying) { _audioSource.Play() }
_audioSource.Stop()
_audioSource.PlayOneShot(_audioClip)
SceneManager
SceneManager.sceneCountInBuildSettings
SceneManager.LoadScene(sceneNumber)
Invoke
Invoke("MethodName", delayInSeconds);
Particle Effects
- Particle System is a component you add to a GameObject
Assets & Colliders
- Check the “Convex” button to make a mesh
Post-Processing
- Create a volume (use global volume for everything)
- Camera -> Rendering
Lighting
Point, spot, directional
Quitting
Application.Quit()
Logging
Terrain
- GameObject -> 3D Object -> Terrain
VisionOS PolySpatial Setup
- Create new Universal 3d Project (URP)
- Open Project Settings
- Select “XR Plugin Management”
- “Install XR Plugin Management” if needed
- Select Vision Pro
- Under Apple visionOS, select “RealityKit with PolySpatial”
- Install PolySpatial
- Create a Volume Camera in your scene
- From the GameObjects > XR > Setup menu or the XR Building Blocks overlay, click Volume Camera.
- Add a VolumeCameraWindowConfiguration asset to your project with Create > PolySpatial > Volume Camera Window Configuration. You must store this asset in one of your project’s Resources folders.
- Assign the volume camera for bounded or unbounded mode and adjust the dimensions (if bounded).
- Dimensions adjust the rendering scale of your content.
- For bounded apps, make sure something is visible within the dimensions of the volume camera.
- Open the Build Profiles window (menu: File > Build Profiles).
- Select the visionOS platform.
- If necessary, click Switch Platform to change to the visionOS platform.
- Add and select any Scenes you want to include in the build. (For example SampleScene.)
- Click the Build button.
Unbounded Apps For unbounded apps that use ARKit features, add the com.unity.xr.arfoundation package to your project. To use skeletal hand tracking data, add the com.unity.xr.hands package to your project.