leave edge state if no longer on edge (moving platform against wall pushes SG back onto platform, etc)

This commit is contained in:
Haze Weathers 2023-06-30 13:18:04 -04:00
parent 75a1091ce8
commit 11286539c6
2 changed files with 7 additions and 0 deletions

View file

@ -282,6 +282,8 @@ func _process_grounded(delta: float) -> void:
#play edge sprite if hanging of edge #play edge sprite if hanging of edge
if !edge_detector.is_colliding(): if !edge_detector.is_colliding():
state_chart.send_event("edge") state_chart.send_event("edge")
else:
state_chart.send_event("off_edge")
## called when player can move left and rightpass # Repass # Rpass # Replace with function body.eplace with function body.place with function body. ## called when player can move left and rightpass # Repass # Rpass # Replace with function body.eplace with function body.place with function body.
func _process_horizontal_movement(delta: float) -> void: func _process_horizontal_movement(delta: float) -> void:

View file

@ -1254,6 +1254,11 @@ script = ExtResource( 10 )
to = NodePath("../../Walking") to = NodePath("../../Walking")
event = "walk_start" event = "walk_start"
[node name="On OffEdge" type="Node" parent="StateChart/Root/Movement/Grounded/CanWalk/Edge"]
script = ExtResource( 10 )
to = NodePath("../../Still")
event = "off_edge"
[node name="Ducking" type="Node" parent="StateChart/Root/Movement/Grounded"] [node name="Ducking" type="Node" parent="StateChart/Root/Movement/Grounded"]
script = ExtResource( 11 ) script = ExtResource( 11 )