2025-08-17 22:13:20 +00:00
|
|
|
class_name CrouchVolume extends Area3D
|
|
|
|
|
|
|
|
|
|
func ready():
|
|
|
|
|
body_entered.connect(notify_player_entry)
|
|
|
|
|
body_exited.connect(notify_player_exit)
|
|
|
|
|
|
|
|
|
|
func notify_player_entry(body: RigidBody3D):
|
2025-12-13 10:06:15 +00:00
|
|
|
print_debug("Player entered Crouch area.")
|
2025-12-13 12:49:08 +00:00
|
|
|
if body is PlayerController:
|
2025-08-17 22:13:20 +00:00
|
|
|
body.inside_crouch_volume.append(self)
|
|
|
|
|
|
|
|
|
|
func notify_player_exit(body: RigidBody3D):
|
2025-12-13 12:49:08 +00:00
|
|
|
if body is PlayerController:
|
2025-08-17 22:13:20 +00:00
|
|
|
body.inside_crouch_volume.erase(self)
|
|
|
|
|
body.crouched = false
|