First-person controller with crouch, sprint and head bob
In your harnessGodot componentMIT
Drive a CharacterBody3D first-person player: mouse look with a pitch limit, walk, sprint and crouch speeds, jumping, head bob, and a crouch that refuses to stand up under a ceiling.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsonexample.tscnfps_controller_3d.gdinspect_gdscript.pyrun_tests.gdtest_package.pytests/test_fps_controller_3d.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorFirstPersonController, extends CharacterBody3D
- Methods
- look(relative: Vector2) -> void; get_pitch() -> float; get_head() -> Node3D; set_move_input(input: Vector2) -> void; set_sprinting(sprinting: bool) -> void; set_crouching(crouching: bool) -> bool; is_crouching() -> bool; press_jump() -> void; and 6 more
- Signals
- jumped, landed, crouch_changed
- Exports
- mouse_sensitivity, pitch_limit_degrees, walk_speed, sprint_speed, crouch_speed, ground_acceleration, air_acceleration, jump_velocity and 13 more
- Placement
- res://baltor/godot_components/fps_controller_3d/
Limits. No ladders, swimming, slopes speed changes or stairs stepping. The collision shape is not resized when crouching; only the head moves, and the stand-up test checks the space above the current shape. Mouse look runs only while the mouse is captured. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.
Details
- Kind
- Godot component
- Engine
- Godot 4.3 or later
- Files
- 12 files, 89.9 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, headless
- Checks
- godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot example scene, godot readme usage compiles
- Techniques
- yaw on body and pitch on head, acceleration toward a wish velocity, sine head bob tied to distance walked, test_move ceiling check
- Tags
- fps, first person, character controller, characterbody3d, crouch, head bob, mouse look
- Identity
library.supply.creative_originals.06195a6d1f0b8b0c2346c9c8.a668e96ee77db2d5- Version
a668e96ee77db2d53c36d67c2cef1eb4c5d27939c1cfb8a2959d571241e2b509
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.