From 826eaac10c63920883b60ec0beedef6e45843121 Mon Sep 17 00:00:00 2001 From: Minimata Date: Thu, 19 Jun 2025 14:36:31 +0200 Subject: [PATCH] fix: jumping and dashing on tilted floor was triggering mantle in bad locations --- systems/mantle/MantleSystem.cs | 2 +- systems/mantle/mantle_system.tscn | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/systems/mantle/MantleSystem.cs b/systems/mantle/MantleSystem.cs index 4cbe14c..f72703c 100644 --- a/systems/mantle/MantleSystem.cs +++ b/systems/mantle/MantleSystem.cs @@ -57,7 +57,7 @@ public partial class MantleSystem: Node3D var shapeCastStartLocation = horizontalEndLocation + Vector3.Up * MantleHeightCastStart; _mantleCast3D.SetGlobalPosition(shapeCastStartLocation); - var targetLocation = Vector3.Down * MantleHeightCastStart; + var targetLocation = Vector3.Down * MantleHeightCastStart + Vector3.Up * MaxStepHeight; _mantleCast3D.SetTargetPosition(targetLocation); if (_mantleCast3D.IsColliding() && _mantleCast3D.GetCollisionNormal(0).Y > 0.9f) diff --git a/systems/mantle/mantle_system.tscn b/systems/mantle/mantle_system.tscn index 7c9d437..8737cbd 100644 --- a/systems/mantle/mantle_system.tscn +++ b/systems/mantle/mantle_system.tscn @@ -5,8 +5,7 @@ [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4coqe"] height = 1.7 -[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qu4wy"] -height = 1.3 +[sub_resource type="SphereShape3D" id="SphereShape3D_2oobp"] [node name="MantleSystem" type="Node3D"] script = ExtResource("1_2oobp") @@ -21,8 +20,8 @@ collision_mask = 2 debug_shape_custom_color = Color(1, 0, 0, 1) [node name="WallInFrontCast3D" type="ShapeCast3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.65, 0) -shape = SubResource("CapsuleShape3D_qu4wy") +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("SphereShape3D_2oobp") target_position = Vector3(0, 0, -1.5) max_results = 1 collision_mask = 2