fix: leaving wall stops wall hugging
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,5 +9,7 @@
|
|||||||
# Godot-specific ignores
|
# Godot-specific ignores
|
||||||
.import/
|
.import/
|
||||||
|
|
||||||
|
/builds
|
||||||
|
|
||||||
# Imported translations (automatically generated from CSV files)
|
# Imported translations (automatically generated from CSV files)
|
||||||
*.translation
|
*.translation
|
@ -58,7 +58,7 @@ custom_features=""
|
|||||||
export_filter="all_resources"
|
export_filter="all_resources"
|
||||||
include_filter=""
|
include_filter=""
|
||||||
exclude_filter=""
|
exclude_filter=""
|
||||||
export_path="./Movement tests.exe"
|
export_path="builds/Movement tests.exe"
|
||||||
patches=PackedStringArray()
|
patches=PackedStringArray()
|
||||||
encryption_include_filters=""
|
encryption_include_filters=""
|
||||||
encryption_exclude_filters=""
|
encryption_exclude_filters=""
|
||||||
|
@ -330,6 +330,12 @@ to = NodePath("../../JumpFromWall")
|
|||||||
event = &"jump"
|
event = &"jump"
|
||||||
delay_in_seconds = "0.0"
|
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"]
|
[node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
|
||||||
script = ExtResource("27_34snm")
|
script = ExtResource("27_34snm")
|
||||||
|
|
||||||
|
@ -181,6 +181,8 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
|
|
||||||
_grounded.StatePhysicsProcessing += HandleGrounded;
|
_grounded.StatePhysicsProcessing += HandleGrounded;
|
||||||
_airborne.StatePhysicsProcessing += HandleAirborne;
|
_airborne.StatePhysicsProcessing += HandleAirborne;
|
||||||
|
_wallHugging.StatePhysicsProcessing += HandleWallHugging;
|
||||||
|
|
||||||
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
||||||
_coyoteTimer.Timeout += CoyoteExpired;
|
_coyoteTimer.Timeout += CoyoteExpired;
|
||||||
_jump.StateEntered += Jump;
|
_jump.StateEntered += Jump;
|
||||||
@ -383,6 +385,12 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
_playerState.SendEvent("wall_hug");
|
_playerState.SendEvent("wall_hug");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HandleWallHugging(float delta)
|
||||||
|
{
|
||||||
|
if (!WallHugSystem.IsWallHugging())
|
||||||
|
_playerState.SendEvent("start_falling");
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
// Stateless logic ////////
|
// Stateless logic ////////
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
@ -23,6 +23,11 @@ config/icon="res://icon.svg"
|
|||||||
|
|
||||||
GUIDE="*res://addons/guide/guide.gd"
|
GUIDE="*res://addons/guide/guide.gd"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=1980
|
||||||
|
window/size/viewport_height=1080
|
||||||
|
|
||||||
[dotnet]
|
[dotnet]
|
||||||
|
|
||||||
project/assembly_name="Movement tests"
|
project/assembly_name="Movement tests"
|
||||||
|
Reference in New Issue
Block a user