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 for- PostProcessing
- 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 there- Compile 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 click- Create 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->- Sphereobject
- You can change Focus range by adjusting - Focus Distancein the- Camera Lens Profiles->- Camera Lens PP Farobject's PostProcessing settings- When adjusting Focus range, don't forget to change the - Auto Focus Distanceon the- Camera 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
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)
- User Interface - 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 
 
- VR Controls - Vr Finger Reference: Reference to the finger tracking object to be used for VR interactions 
- Sphere Radius: The size of the sphere triggers 
- Tutorial Sphere: The position of the tutorial pass sphere trigger 
- Flip Sphere: The position of the camera flip sphere trigger 
- Always On Sphere: The position of the always on sphere trigger 
- Focus Sphere: The position of the autofocus sphere trigger 
- World Space Sphere: The position of the world space / local space switch sphere trigger 
 
- 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 call- ResetOffsetson 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 Systemfrom- UdonToolkit/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 not- PostProcessingor- Default
- Don't forget to update the target layer of the - PostProcessing Layercomponent on the- Camera Lens->- Lens Cameraobject
- When using a custom VR Controls layer, make sure to change tha layer of - Camera Left Finger, as well as the- VR Controlsand- Start Sphereobjects
- If you changed the VR Controls layer - you'll also need to update it in each - Sphereobject's Area Trigger- Collide Withparameter
 
- Click - Compile All UdonSharp Programs
- Check that every UdonBehaviour in the system shows set public variables: check - Camera Lens, any of the- VR Controls->- Sphereobjects,- Camera Trackerobject, any of the- Camera Flip,- Always On,- Focusand- Switch Positionobjects- If any of them show - No Public Variables- click- Force Compile Script
 
- Click on the - Camera Lensobject and uncheck- Is Activeon the- Parent Constraint
- Move the Camera Lens wherever you want 
- Click - Activateon the- Parent Constraint
- Uncheck - Is Active, expand- Constraint Settings
- Uncheck - Lockand set all the- Position Offsetand- Rotation Offsetvalues to 0, check- Lockagain
- Check - Is Active
- You should now be ready to use the camera in your world! 
Last updated