fix: now hanging on walls of all orientations
This commit is contained in:
@ -152,7 +152,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
{
|
{
|
||||||
if (WeaponSystem.FlyingState.Active)
|
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)
|
else if (WeaponSystem.PlantedState.Active)
|
||||||
{
|
{
|
||||||
@ -160,6 +160,7 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.PlayerDashLocation, Vector3.Zero);
|
DashSystem.DashResolve = new DashResolveRecord(false, WeaponSystem.PlayerDashLocation, Vector3.Zero);
|
||||||
}
|
}
|
||||||
_dashDirection = (DashSystem.DashResolve.DashLocation - GlobalPosition).Normalized();
|
_dashDirection = (DashSystem.DashResolve.DashLocation - GlobalPosition).Normalized();
|
||||||
|
GD.Print(_dashDirection);
|
||||||
DashSystem.Dash();
|
DashSystem.Dash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +187,8 @@ public partial class PlayerController : CharacterBody3D
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store the weapon state before resetting it
|
// 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;
|
var isFlying = WeaponSystem.FlyingState.Active;
|
||||||
|
|
||||||
// Get the weapon back
|
// Get the weapon back
|
||||||
|
@ -73,6 +73,7 @@ public partial class WeaponSystem : RigidBody3D
|
|||||||
_weaponState.SendEvent("plant");
|
_weaponState.SendEvent("plant");
|
||||||
Freeze = true;
|
Freeze = true;
|
||||||
GlobalPosition = _plantLocation;
|
GlobalPosition = _plantLocation;
|
||||||
|
PlayerDashLocation = _plantLocation + _plantNormal * 0.1f;
|
||||||
LookAt(GlobalTransform.Origin + _plantNormal, Vector3.Up, true);
|
LookAt(GlobalTransform.Origin + _plantNormal, Vector3.Up, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user