Default Camera Modes
The camera system comes with a few pre-built camera modes.
Humanoid Camera Mode
This camera mode is the main character camera mode. It attaches to the Humanoid component.
Most likely, this will be used as the default camera.
Orbit Camera Mode
The Orbit Camera Mode attaches the camera to a Unity Transform component and lets the user rotate the camera around the transform. The distance away from the transform is locked to the value set in the constructor.
This is a useful camera mode for observing other players or objects.
If you wish to use the OrbitCameraMode in the context of controlling the local player, then the entity's graphical transform must be passed to the constructor as well. This is necessary because the top-level character game object is not the same as the visual model, which will have different positioning.
Static Camera Mode
The Static Camera Mode simply keeps the camera in a static position and rotation.
Fly Camera Mode
The Fly Camera Mode allows the user to fly around the map using WASDQE keys for movement and right-click-drag for rotation.
Here is an example that sets the default camera mode to the Humanoid Camera Mode, but toggles the Fly Camera Mode when the LeftShift+P key is pressed:
Last updated