Camera System
A Depth of Field camera system with VR Friendly physical controls and a desktop mode

Quick Setup Guide
Follow the general installation guide
Import the PostProcessing package by clicking
Window->Package Managerin Unity and searching forPostProcessingCreate an empty object in your scene where you want your camera to be spawned
Click on
Window->UdonToolkit->Camera System Setupin the unity top barDrag 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 LayersClick
Create Camera SystemClick on the created
Camera Lensobject and thereCompile All Udon Sharp Programsat the bottom of the Udon Behaviour componentYou'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!

Full Documentation

Customization tips
You can change the watermark after the creation of Camera System via the setup script by adjusting the material on
Camera Tracker->SphereobjectYou can change Focus range by adjusting
Focus Distancein theCamera Lens Profiles->Camera Lens PP Farobject's PostProcessing settingsWhen adjusting Focus range, don't forget to change the
Auto Focus Distanceon theCamera LensobjectYou can adjust minimum focal length by changing the Focal Length in the
Camera Lens Profiles->Camera Lens PP Focalobject's PostProcessing settingsYou can adjust maximum focal length by changing the Focal Length in the
Camera Lens Profiles->Camera Lens PPobject's PostProcessing settingsYou can adjust finger sphere's size and look by changing the
Camera Left Finger->Sphereobject
Parameters
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 enabledAlways On Icon: Always On Frame in Desktop UO that will be colored
Active Control Colorwhen enabledActive 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)
Events
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
Usage and Examples
Drag and drop
UT Camera SystemfromUdonToolkit/Camera Systemfolder into the sceneRight 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 notPostProcessingorDefaultDon't forget to update the target layer of the
PostProcessing Layercomponent on theCamera Lens->Lens CameraobjectWhen using a custom VR Controls layer, make sure to change tha layer of
Camera Left Finger, as well as theVR ControlsandStart SphereobjectsIf you changed the VR Controls layer - you'll also need to update it in each
Sphereobject's Area TriggerCollide Withparameter
Click
Compile All UdonSharp ProgramsCheck 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 PositionobjectsIf any of them show
No Public Variables- clickForce Compile Script
Click on the
Camera Lensobject and uncheckIs Activeon theParent ConstraintMove the Camera Lens wherever you want
Click
Activateon theParent ConstraintUncheck
Is Active, expandConstraint SettingsUncheck
Lockand set all thePosition OffsetandRotation Offsetvalues to 0, checkLockagainCheck
Is ActiveYou should now be ready to use the camera in your world!
Last updated