Spectator View

The spectator view is separate Multiplayer Prefab, with which you can switch between predefined NetworkObjects and watch what they do.
Functionality
The Spectator View has the following functionality:
- Available object list
- – List of all available objects and switch directly to an object out of the list
- – Mark Favorites, that are always on top of the list
- – Exclude/Include objects from auto/manual switch
- – Search for specific objects in List
- – Set First Person View or Orbit View for objects in List
- Home Object– Mark your object as a home object and switch directly to the object
- Ghost Mode – Disable Colliders and move through all objects in the scene, no boundaries anymore
- Height Lock – Lock your height and just move on the x- and z-Axis
- First Person Cam – Move from orbit mode to first person view of the object attached to
- Search: Search Field functionality in code changed to Search Only Functionality
- Random Duration: Random Value for AutoSwitch Mode – The duration on the object is randomized between a min and max
- Keybinds: Keybinding FirstPerson/ThirdPerson(C), ghost mode (G), height Lock (F)
- Idle Timer: After a predefined in Idle State at FreeMove do a switch back to Auto Switch mode and move to the next target
Hot Keys
- W/A/S/D: Switch to Freefly mode and fly around
- N: Select next object in list
- P: Select prev object in list
- H: Hide all UI Elements
- F: Toggle Fixed Height
- G: Toggle Ghost Mode
- X: Toggle Auto Switch
- B: When in freefly attach to the object targeted
- C: Toggle cameras from First person view to orbit view (3rd person)
- Left Mouse click and move: Move the camera in orbit and first person mode
- Mouse movement: Rotate the spectator in freefly mode
SpectatorNetwork Prefab
On the spectator network Prefab you have multiple options you can change:

Object Type Filter List: You can add NononZoneObject types to the list and tick it. The auto and manual switch will then only switch between these objects.
Auto Settings
Time 4 Reset Third Person: Time to switch back from Chasing Cam to Orbit Cam
Auto Reset 3rd Person: Tick this if you want to automatically switch back from Chasing to Orbit Cam while chasing is active. If this is not active, the cam will switch when there is no aggro anymore.
Time 4 Auto Switch: Time for the automatic switch between the objects.
Idle Time 3 Auto Switch: Time when in Freefly mode and doing nothing, before it switches back to auto Switch
Ghost mode Settings
Ghost mode: If checked, the ghost mode feature is enabled. This enables the spectator to move through objects without colliding.
Fixed Height Settings
Fixed Height: If checked, the fixed height feature is enabled. (if this is enabled the ghost mode is automatically active too)
Distance fixed Height: If fixed height is enabled, the spectator is flying down to the distance configured
Raycast Distance fixed Height: The distance the spectator looks for a ground. If above, the height will not be adjusted
Move to fixed height multiplier: The multiplier of the time it takes to adapt the height. If too low the adaption might not work to steep hills.
Object Cam Settings
Fpv Rotation Speed Multiplier: Multiplier of the Rotation speed in first person view
Fpv Position Offset Multiplier: Offset in the direction of movement where the camera is placed.
Position Offset Percentage: Percentage of the collider for which the camera is moved down. e.g. 0.25 means the camera is moved 1/4 of the whole collider size down from the top
Camera and UI Objects Settings
Is UI Initial Visible: If true the whole UI is visible at the start. if not it is hidden (same as -h)
Spectator Camera CM Network
This script is attached to the main camera. In this one you have two settings:

CameraMovement SensitivityX: sensitivity of the camera movement on the X Axis
CameraMovement SensitivityY: sensitivity of the camera movement on the Y Axis
0 Comments