-
Notifications
You must be signed in to change notification settings - Fork 6
Camera System
A Depth of Field camera system with VR Friendly physical controls and a desktop mode
- Follow the general installation guide
- Import the PostProcessing package by clicking
Window->Package Managerin Unity and searching forPostProcessing - Create an empty object in your scene where you want your camera to be spawned
- Click on
Window->UdonToolkit->Camera System Setupin the unity top bar - Drag and drop the created empty into the Camera Position field
- Provide a watermark overlay if you want to draw a watermark on top of the pictures people take, e.g. the world logo
The watermark should be a transparent 16:9 image (1920x1080)
- You can also add one of the default guide panels near the camera by checking "Add Camera Guide". This option is recommended, so your players know how to use the system
- Click
Setup Layers - Click
Create Camera System - Click on the created
Camera Lensobject and thereCompile All Udon Sharp Programsat the bottom of the Udon Behaviour component - You're done!
- If the positioning isn't exactly how you like it:
Ctrl+Z, move the empty object and clickCreate Camera Systemagain
Now you can build your project, and the camera should be working!
- You can change the watermark after the creation of Camera System via the setup script by adjusting the material on
Camera Tracker->Sphereobject - You can change Focus range by adjusting
Focus Distancein theCamera Lens Profiles->Camera Lens PP Farobject's PostProcessing settings
When adjusting Focus range, don't forget to change the
Auto Focus Distanceon theCamera Lensobject
- You can adjust minimum focal length by changing the Focal Length in the
Camera Lens Profiles->Camera Lens PP Focalobject's PostProcessing settings - You can adjust maximum focal length by changing the Focal Length in the
Camera Lens Profiles->Camera Lens PPobject's PostProcessing settings - You can adjust finger sphere's size and look by changing the
Camera Left Finger->Sphereobject
- Active: Specifies whether the camera is actively responding to inputs
- Lens Animator: An animator that controls Camera PostProcessing profiles
- Camera Animator: The main animator that controls Camera UI
- Pickup: The camera pickup component
- Auto Focus: Specifies whether the auto focus is currently enabled
-
Auto Focus Distance: Specifies the auto focus max distance (should correspond to the
Camera Lens PP Farfocus distance setting) - Desktop UI: The UI Canvas for Desktop players
- VR UI: The UI Canvas for VR Players
- Focus/Focal/Zoom Sliders: The Focus/Focal/Zoom UI Sliders for Desktop
- VR Focus/Focal/Zoom Sliders: The Focus/Focal/Zoom UI Sliders for VR
- Focus/Focal/Zoom Text: The Focus/Focal/Zoom UI Text that is adjusted to display the currently active control
- Focus/Focal/Zoom BG: The Focus/Focal/Zoom UI Text that is adjusted to display the currently active control
- Position Text: UI Text that displays if the camera exists in World or Player relative space
- View Sphere: The Camera View sphere which override's player's desktop view or camera view (based on type of player)
- Camera Object: Object that has a Camera component on it
- Visuals: The camera visual mesh
-
Finger Sphere: The Mesh Renderer of the finger collider (
_Enabledproperty will be set depending on whether the camera is held) -
Auto Focus Icon: Auto Focus Frame in Desktop UI that will be colored
Active Control Colorwhen enabled -
Always On Icon: Always On Frame in Desktop UO that will be colored
Active Control Colorwhen enabled - Active Control Color: The color used in Desktop UI to signify that control is enabled
- Drop Target: The Transform camera will be reparented to when Player relative space lock is enabled
-
Playspace Tracker: The Universal Tracker instance with
Track Playspaceenabled (camera will automatically callResetOffsetson it whenever it is picked up and dropped)
- SwitchPosition: Switches between World and Player relative positioning
- FlipCamera: Flips the camera direction and screen
- SwitchAF: Toggles Auto Focus on and off
- SwitchControl: Switches between currently active controls (Focus/Focal/Zoom)
- ToggleAlwaysOn: Toggles the Always On mode (camera stays active on drop when Always On is enabled)
- ToggleWatermark: Toggles final image watermark on and off
You are expected to use Camera System Setup UI from Window -> UdonToolkit -> Camera System Setup in the unity top bar to set everything up, consult the top of this page for the required steps. But here is a guide on the manual setup
- Drag and drop
UT Camera SystemfromUdonToolkit/Camera Systemfolder into the scene - Right click and click
Unpack Prefab Completely(that is very important) - Move out all the objects inside
UT Camera Systeminto the root of the scene (also important) - By default camera is set up to use layer 27 for PostProcessing, and layer 28 for the VR Controls
- VR Controls layer is expected to be set to only collide with itself, otherwise you might get unwanted vr control interactions even if you did not actually press anything with your finger
- Make sure those exist or change them
- You can set objects inside
Camera Lens Profilesto any layer that is notPostProcessingorDefault - Don't forget to update the target layer of the
PostProcessing Layercomponent on theCamera Lens->Lens Cameraobject - When using a custom VR Controls layer, make sure to change tha layer of
Camera Left Finger, as well as theVR ControlsandStart Sphereobjects - If you changed the VR Controls layer - you'll also need to update it in each
Sphereobject's Area TriggerCollide Withparameter
- You can set objects inside
- Click
Compile All UdonSharp Programs - Check that every UdonBehaviour in the system shows set public variables: check
Camera Lens, any of theVR Controls->Sphereobjects,Camera Trackerobject, any of theCamera Flip,Always On,FocusandSwitch Positionobjects- If any of them show
No Public Variables- clickForce Compile Script
- If any of them show
- Click on the
Camera Lensobject and uncheckIs Activeon theParent Constraint - Move the Camera Lens wherever you want
- Click
Activateon theParent Constraint - Uncheck
Is Active, expandConstraint Settings - Uncheck
Lockand set all thePosition OffsetandRotation Offsetvalues to 0, checkLockagain - Check
Is Active - You should now be ready to use the camera in your world!
This is a bit of an involved process, hence why the automated setup was created, the manual guide is provided for reference of what UdonToolkit is actually doing when you click
Create Camera System
🚨 Found an issue? File an issue
💬 Join the Discord server
🕶 Support the project if you found it useful


