โ† All examples

godot components

Trauma screen shake for Camera2D

Shake a Camera2D from a decaying trauma value: the shake is trauma to a power, and smooth seeded noise moves the offset and roll within set limits. The camera returns to its original offset and rotation when the shake ends.

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • example.tscn
  • inspect_gdscript.py
  • run_tests.gd
  • test_package.py
  • tests/test_trauma_screen_shake_2d.gd
  • trauma_screen_shake_2d.gd
  • verification/native.json

How it works

Class
BaltorTraumaShake2D, extends Node
Methods
add_trauma(amount: float) -> void; set_trauma(value: float) -> void; get_trauma() -> float; get_shake() -> float; offset_at(time: float) -> Vector2; roll_at(time: float) -> float; get_target_camera() -> Camera2D; advance(delta: float) -> void
Signals
shake_started, shake_finished
Exports
target_path, max_offset, max_roll_degrees, decay_per_second, exponent, frequency, noise_seed
Placement
res://baltor/godot_components/trauma_screen_shake_2d/

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_example_scene
  • godot_readme_usage_compiles

Limits to consider

2D cameras only; it writes Camera2D.offset and rotation, so another script writing them at the same time fights it. Noise values are clamped to -1..1; FastNoiseLite simplex output rarely reaches the ends, so the full offset is seldom reached. The motion repeats for a seed on this engine build; the noise library may differ between engine versions. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.