View on Asset Store (opens in new tab)
Package details
- Latest version
- 2.0.0
- Last updated
- First released
- Unity version
- 6000.0.47 or later
- Package size
- 204 KB
- Files
- 8
- Favorites
- 116
- Views in the past week
- 57
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- Free on
Keywords
First Person Camera Script
A production-ready first-person camera controller for Unity with wall collision, realistic headbob, aim zoom, and framerate-independent input
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 5
First Person Camera Script screenshot 1
About this asset
`FirstPersonCameraScript` is a drop-in first-person camera controller built for
Unity. Attach it to your camera, point it at your player, and you get smooth
mouse look, FOV-based aim zoom, sinusoidal headbob, wall collision prevention,
and a landing shake all configurable from the Inspector with no code required.
## QUICK SETUP
1. Add `FirstPersonCameraScript` to your Camera GameObject.
2. Assign **Player Body** (your player root Transform) in the Inspector.
3. Assign **Player Camera** (the Camera component) or leave blank to
auto-detect.
4. Assign **Player Controller** or leave blank to auto-detect.
5. Set `Wall Collision Mask` to your environment layers (exclude the Player
layer to avoid self-hit).
6. Press Play.
From the publisher's Asset Store listing.
Technical details
## TECHNICAL DETAILS
| Property | Value |
| **Script language** | C# |
| **Namespace** | `FirstPersonCamera` |
| **Class name** | `FirstPersonCameraScript` |
| **Inherits from** | `MonoBehaviour` |
| **Update loops used** | `Update` (input / zoom / headbob), `LateUpdate` (position / wall collision) |
| **Physics API** | `Physics.SphereCastAll` — no Rigidbody required on the camera |
| **Input API** | Legacy `Input.GetAxis` / `Input.GetKey` |
| **Allocations at runtime** | `SphereCastAll` allocates a `RaycastHit[]` per frame when wall collision is enabled. All other logic is allocation-free. |
| **Number of scripts** | 2 (`FirstPersonCameraScript.cs`, `PlayerController.cs`) |
| **Number of lines (camera)** | ~400 |
| **Inspector headers** | 7 (Mouse Look, Constraints, Smoothing, References, Zoom/Aim, Wall Collision, Headbob + Landing) |
| **Public methods** | 5 (`SetMouseSensitivity`, `SetVerticalLimits`, `ResetRotation`, `SetInvertMouse`, `SetSmoothing`) |
| **Serialised fields** | 30 |
| **Minimum setup** | Attach script + assign Player Body — everything else auto-detects |
| **Render pipeline support** | Built-in RP, URP, HDRP |
| **Unity version minimum** | 2022.3 LTS |
| **Platform support** | Any platform that supports `Physics.SphereCastAll` and Legacy Input |
Compatibility
| Unity version | Built-in | URP | HDRP |
|---|---|---|---|
| 6000.0.47f1 | Compatible | Compatible | Compatible |
- Compatible with Unity’s Built-in RP and tested with URP. Works with HDRP but may need minor tweaks for post-processing effects. Fully script-based, no SRP-specific dependencies, and supports all pipelines with minimal setup.
As listed on the Asset Store.