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 Manager
in 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 Setup
in 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 Layers
Click
Create Camera System
Click on the created
Camera Lens
object and thereCompile All Udon Sharp Programs
at 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 System
again
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
->Sphere
objectYou can change Focus range by adjusting
Focus Distance
in theCamera Lens Profiles
->Camera Lens PP Far
object's PostProcessing settingsWhen adjusting Focus range, don't forget to change the
Auto Focus Distance
on theCamera Lens
objectYou can adjust minimum focal length by changing the Focal Length in the
Camera Lens Profiles
->Camera Lens PP Focal
object's PostProcessing settingsYou can adjust maximum focal length by changing the Focal Length in the
Camera Lens Profiles
->Camera Lens PP
object's PostProcessing settingsYou can adjust finger sphere's size and look by changing the
Camera Left Finger
->Sphere
object
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 Far
focus 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 (
_Enabled
property 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 Color
when enabledAlways On Icon: Always On Frame in Desktop UO that will be colored
Active Control Color
when 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 Playspace
enabled (camera will automatically callResetOffsets
on 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
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 System
fromUdonToolkit/Camera System
folder into the sceneRight click and click
Unpack Prefab Completely
(that is very important)Move out all the objects inside
UT Camera System
into 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 Profiles
to any layer that is notPostProcessing
orDefault
Don't forget to update the target layer of the
PostProcessing Layer
component on theCamera Lens
->Lens Camera
objectWhen using a custom VR Controls layer, make sure to change tha layer of
Camera Left Finger
, as well as theVR Controls
andStart Sphere
objectsIf you changed the VR Controls layer - you'll also need to update it in each
Sphere
object's Area TriggerCollide With
parameter
Click
Compile All UdonSharp Programs
Check that every UdonBehaviour in the system shows set public variables: check
Camera Lens
, any of theVR Controls
->Sphere
objects,Camera Tracker
object, any of theCamera Flip
,Always On
,Focus
andSwitch Position
objectsIf any of them show
No Public Variables
- clickForce Compile Script
Click on the
Camera Lens
object and uncheckIs Active
on theParent Constraint
Move the Camera Lens wherever you want
Click
Activate
on theParent Constraint
Uncheck
Is Active
, expandConstraint Settings
Uncheck
Lock
and set all thePosition Offset
andRotation Offset
values to 0, checkLock
againCheck
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
Last updated