🎥Camera Follower
Simple system to follow objects and do Shake/FOV effects, wokrs with Cinemachine by default.
Suitable for simple camera behaviours: - Follows targets position (also rotation) without obstacles avoid - Has Shake effect module - Has FOV/Orthographic handler module - Point of view (POV) states and switch between them smoothly. Editor POV create and preview logic in inspector.
How it works
You can find prefab in _Main\Prefabs\Common\CameraCustom\CameraHolder.prefab


"CameraHolder" object is holder of Camera custom system. "Camera [parent]" object is additional layer for Object shake. CameraHolder moves camera parent in POV change operations and it's posible to do shake while POV changing. Holder has MainCamera object reference (camera itself with Cinemachine brain on it) and Main Virtual Camera is Cinemachine virtual camera.
You can add more Virtual cameras in scene and with custom logic and switch between them with Virtual camera priority property. We often use CameraHolder as default camera follower for player and add few virtual cameras to make cutscenes with it and transitions.

Follow Target -> what should CameraHolder follow
Copy Follow Target Rotation -> should CameraHolder follow target object rotation too?
Follow Position Lerp -> how fast will CameraHolder follow to target object position less value -> more time needs to reach target completely
Follow Rotation Lerp -> the same as Follow Position Lerp but for rotation (has no effect if Copy Follow Target Rotation set to false)
Change POV Pos/Rot curves controlles how POV MainCamera local Pos/Rot with change from one to another (interpolates from 0 to 1)
Camera POV_s -> core component to switch "Camera [parent]" object local Pos+Rot by POV (point of view) name or array index. MainCamera replaced under Camera [parent] so we can freely change Camera [parent] local Pos+Rot and Camera POV_s is array of point of views (states).
Change Target Position/Rotation curves -> controlles how Camera (holder) Pos/Rot with change from current Camera (holder) point to new Follow Target point (interpolates from 0 to 1).
You should keep "Main camera" object local position and rotation as (0, 0, 0) and change Camera [parent] instead.
EDITOR TOOLS
POV index -> current selected editor Camera POV_s index to perform operations: - Preview POV (toggle it on and "Camera [parent]" transform will set to POV index from Camera POV_s array) - Refresh POV index (button) -> refreshes POV from Camera POV_s array by POV index. Values will be taken from "Camera [parent]" current transform values.
Add POV to end (button) -> creates POV by taking current "Camera [parent]" transform values and adds it to the end of Camera POV_s
Connected modules
Camera Custom uses Object Shake and CameraFOVHandler. They can be accessed by CameraFollower instance -> ShakeEffect and CameraFOVHandler properties. more API -> see script CameraFollower.
Example of Camera Custom can be found here: _Examples\Camera Custom\Example.scene
Last updated