diff --git a/objects/player/player.gd b/objects/player/player.gd index 8390c2e..d749296 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -54,6 +54,7 @@ onready var pushable_detector: RayCast2D = $"%PushableDetector" onready var oxygen_timer = $OxygenTimer onready var low_oxygen_label = $LowOxygenLabel onready var edge_detector = $Graphics/EdgeDetector +onready var body_shape: CollisionShape2D = $"%BodyShape" # OVERRIDES # func _ready() -> void: @@ -274,6 +275,13 @@ func _on_Respawn_state_entered() -> void: func _on_Edge_state_entered(): animation_player.play("edge") +func _on_Inactive_state_entered() -> void: + body_shape.disabled = true + +func _on_Inactive_state_exited() -> void: + body_shape.disabled = false + + # STATE PROCESSING # ## when on ground func _process_grounded(delta: float) -> void: diff --git a/objects/player/player.tscn b/objects/player/player.tscn index c8ae6b3..6abf9d8 100644 --- a/objects/player/player.tscn +++ b/objects/player/player.tscn @@ -1013,7 +1013,7 @@ tracks/3/keys = { [node name="Player" type="KinematicBody2D" groups=["player"]] collision_layer = 128 collision_mask = 7 -moving_platform_apply_velocity_on_leave = 1 +moving_platform_apply_velocity_on_leave = 2 script = ExtResource( 1 ) walk_acceleration_frames = 4.0 gravity = 700.0 @@ -1562,6 +1562,8 @@ align = 1 [connection signal="state_entered" from="StateChart/Root/Movement/Climbing" to="." method="_on_Climbing_state_entered"] [connection signal="state_exited" from="StateChart/Root/Movement/Climbing" to="." method="_on_Climbing_state_exited"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Climbing" to="." method="_process_climbing"] +[connection signal="state_entered" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_entered"] +[connection signal="state_exited" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_exited"] [connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Drowning" to="." method="_on_Drowning_state_entered"]