fix: jumping and dashing on tilted floor was triggering mantle in bad locations

This commit is contained in:
2025-06-19 14:36:31 +02:00
parent 21bc3f4724
commit 826eaac10c
2 changed files with 4 additions and 5 deletions

View File

@ -57,7 +57,7 @@ public partial class MantleSystem: Node3D
var shapeCastStartLocation = horizontalEndLocation + Vector3.Up * MantleHeightCastStart; var shapeCastStartLocation = horizontalEndLocation + Vector3.Up * MantleHeightCastStart;
_mantleCast3D.SetGlobalPosition(shapeCastStartLocation); _mantleCast3D.SetGlobalPosition(shapeCastStartLocation);
var targetLocation = Vector3.Down * MantleHeightCastStart; var targetLocation = Vector3.Down * MantleHeightCastStart + Vector3.Up * MaxStepHeight;
_mantleCast3D.SetTargetPosition(targetLocation); _mantleCast3D.SetTargetPosition(targetLocation);
if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y > 0.9f) if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y > 0.9f)

View File

@ -5,8 +5,7 @@
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4coqe"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4coqe"]
height = 1.7 height = 1.7
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qu4wy"] [sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"]
height = 1.3
[node name="MantleSystem" type="Node3D"] [node name="MantleSystem" type="Node3D"]
script = ExtResource("1_2oobp") script = ExtResource("1_2oobp")
@ -21,8 +20,8 @@ collision_mask = 2
debug_shape_custom_color = Color(1, 0, 0, 1) debug_shape_custom_color = Color(1, 0, 0, 1)
[node name="WallInFrontCast3D" type="ShapeCast3D" parent="."] [node name="WallInFrontCast3D" type="ShapeCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.65, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_qu4wy") shape = SubResource("SphereShape3D_2oobp")
target_position = Vector3(0, 0, -1.5) target_position = Vector3(0, 0, -1.5)
max_results = 1 max_results = 1
collision_mask = 2 collision_mask = 2