โ† All examples

godot components

Third-person orbit camera with collision pull-in

Orbit a Camera3D around a target with yaw, pitch and zoom limits, smooth distance changes and a ray that pulls the camera in front of walls so the target stays visible.

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • inspect_gdscript.py
  • orbit_camera_3d.gd
  • run_tests.gd
  • test_package.py
  • tests/test_orbit_camera_3d.gd
  • verification/native.json

How it works

Class
BaltorOrbitCamera3D, extends Camera3D
Methods
orbit_offset(yaw: float, pitch: float, length: float) -> Vector3; orbit(delta_yaw_degrees: float, delta_pitch_degrees: float) -> void; zoom(amount: float) -> void; get_target() -> Node3D; get_pivot() -> Vector3; get_current_distance() -> float; update_camera(delta: float) -> void
Exports
target_path, target_offset, yaw_degrees, pitch_degrees, distance, min_distance, max_distance, min_pitch_degrees and 8 more
Placement
res://baltor/godot_components/orbit_camera_3d/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • godot_parse_check_only
  • godot_gdscript_tests
  • godot_tests_reject_gutted_component
  • godot_editor_import
  • godot_contract_reflection
  • godot_readme_usage_compiles

Limits to consider

One ray from the pivot; thin gaps can still let the near plane clip into walls, so keep collision_margin above the camera's near distance. No auto-rotation behind the target and no lock-on. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.