🎯 ZionTPS
Modular Third-Person Locomotion · Unity 6 · Version 1.2
Camera System
ZionTPS includes a third-person camera rig with smooth follow, orbit input, collision handling, camera profiles, optional input smoothing, stance behaviour, dynamic FOV, recentering, and camera shake.
Camera Rig Structure
ZionTPS_CameraRig
|- YawPivot
| |- PitchPivot
| |- Camera
`- CameraControllerRig
The rig remains separate from the visual character hierarchy. It follows a CameraTarget
on the player and uses the pivots to calculate orbit and camera position.
Runtime Profiles vs Authoring Presets
ZionTPS uses two related but different concepts:
- Runtime profiles - Default, Combat, and Aim are separate CameraProfile assets that can be switched during gameplay.
- Authoring presets - Responsive, Exploration, Combat, and Cinematic buttons overwrite a profile with a useful starting point for tuning.
Use presets to begin tuning a profile, then adjust the resulting values for your own game.
Default, Combat, and Aim
- Default - balanced distance and movement framing.
- Combat - closer, faster response and modest shoulder offset.
- Aim - tighter over-the-shoulder camera intended for focus or aiming.
Assign the three generated assets to the Camera Rig's Runtime Profiles section. Camera profile actions only produce a visible change when the assigned profiles have meaningfully different values.
Camera Framing
Recommended starting direction:
- Default: neutral X offset, balanced distance, moderate pitch range.
- Combat: slightly closer distance and small positive X shoulder offset.
- Aim: tighter distance, stronger positive X shoulder offset, narrower pitch range.
Collision
Camera collision uses an obstacle cast from the pivot toward the intended camera position. It pulls the camera inward around walls and returns it smoothly when clearance becomes available.
- Include level walls, ceilings, terrain, and cover in the Collision Mask.
- Exclude the player hierarchy from the collision mask where your layer setup allows it.
- Use real colliders on test walls and crouch cover.
- Keep collision radius and buffer modest; very large values can make camera distance feel unstable.
Recentering
Camera recentering returns the camera behind the player when requested. Bind the optional
CameraRecenter action to an input you can reach comfortably, then test it with mouse and gamepad.
Field of View and Stance Behaviour
- Dynamic FOV can add speed-based FOV movement.
- Sprint FOV can be tuned separately for readable sprint feedback.
- Crouch and Roll Pivot Offset values lower the camera with the player stance.
- Use smoothing for stance offsets so changes feel deliberate rather than abrupt.
Camera Profile API
// Apply a profile immediately or with the rig transition.
cameraRig.ApplyProfile(profile, instant: false);
// Move the camera to a chosen distance.
cameraRig.SetDistance(3.0f);
// Add a small procedural shake.
cameraRig.AddCameraShake(0.15f);
Camera Test Checklist
- Orbit in open space and confirm the character remains framed.
- Stand near a wall and rotate the camera through the obstruction.
- Enter a crouch tunnel, release crouch, and orbit carefully under cover.
- Run, sprint, crouch, roll, jump, and climb a ramp.
- Switch between Default, Combat, and Aim if those actions are enabled.
- Test recentering and verify that no recurring Console warnings appear.