fix: now hanging on walls of all orientations

This commit is contained in:
2025-06-08 08:58:30 +02:00
parent 55f036f725
commit 38e996abaa
2 changed files with 5 additions and 2 deletions

View File

@ -152,7 +152,7 @@ public partial class PlayerController : CharacterBody3D
{
if (WeaponSystem.FlyingState.Active)
{
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.PlayerDashLocation, Vector3.Zero);
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.GlobalPosition, Vector3.Zero);
}
else if (WeaponSystem.PlantedState.Active)
{
@ -160,6 +160,7 @@ public partial class PlayerController : CharacterBody3D
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.PlayerDashLocation, Vector3.Zero);
}
_dashDirection = (DashSystem.DashResolve.DashLocation - GlobalPosition).Normalized();
GD.Print(_dashDirection);
DashSystem.Dash();
}
@ -186,7 +187,8 @@ public partial class PlayerController : CharacterBody3D
}
// Store the weapon state before resetting it
var isPlantedOnWall = WeaponSystem.PlantedState.Active && WeaponSystem.GlobalRotation.Dot(Vector3.Up) < 0.1;
var isPlantedOnWall = WeaponSystem.PlantedState.Active
&& (Math.Abs(WeaponSystem.GlobalRotation.X) + Math.Abs(WeaponSystem.GlobalRotation.Z) < 0.3);
var isFlying = WeaponSystem.FlyingState.Active;
// Get the weapon back