- (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
- ` 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:

- drag object tree to Project to create prefab
- right-click on "Transform" to reset
- Every GameObject has:
- A transform component
- Translate
- Rotate
- A tag
- An active flag. When false object doesn't appear, and colliders and scripts don't run.
- A transform component
- 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.current.cKey.isPressed
Keyboard.current.cKey.wasPressedThisFrame
- 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);
- Install from Package Manager (Unity Registry)
- Right-click on hierarchy, and choose Cinemachine
- AudioClip
- AudioSource
- AudioListener
if (!_audioSource.isPlaying) { _audioSource.Play() }
_audioSource.Stop()
_audioSource.PlayOneShot(_audioClip)
SceneManager.sceneCountInBuildSettings
SceneManager.LoadScene(sceneNumber)
Invoke("MethodName", delayInSeconds);
- Particle System is a component you add to a GameObject
- Check the "Convex" button to make a mesh
- Create a volume (use global volume for everything)
- Camera -> Rendering
Point, spot, directional
Application.Quit()
Debug.Log("Message");
- GameObject -> 3D Object -> Terrain
- 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 icy 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.
There is one necessary GameObject to have in each hand-tracking XR scene in your app: an XR Origin.
To create an XR Origin, right-click in the Hierarchy window, and select the following option from the context menu.