fix: leaving wall stops wall hugging
This commit is contained in:
@ -330,6 +330,12 @@ to = NodePath("../../JumpFromWall")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/Airborne/WallHugging"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Falling")
|
||||
event = &"start_falling"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
|
@ -181,6 +181,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
|
||||
_grounded.StatePhysicsProcessing += HandleGrounded;
|
||||
_airborne.StatePhysicsProcessing += HandleAirborne;
|
||||
_wallHugging.StatePhysicsProcessing += HandleWallHugging;
|
||||
|
||||
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
||||
_coyoteTimer.Timeout += CoyoteExpired;
|
||||
_jump.StateEntered += Jump;
|
||||
@ -383,6 +385,12 @@ public partial class PlayerController : CharacterBody3D
|
||||
_playerState.SendEvent("wall_hug");
|
||||
}
|
||||
|
||||
public void HandleWallHugging(float delta)
|
||||
{
|
||||
if (!WallHugSystem.IsWallHugging())
|
||||
_playerState.SendEvent("start_falling");
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
// Stateless logic ////////
|
||||
///////////////////////////
|
||||
|
Reference in New Issue
Block a user