more tuts, respawn mechanic when falling, reworked wall run again
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Test (push) Successful in 7m37s
Create tag and build when new code gets to main / Export (push) Has been cancelled
Create tag and build when new code gets to main / ReleaseName (push) Successful in 10s
Create tag and build when new code gets to main / Release (push) Failing after 4m53s

This commit is contained in:
2026-02-11 17:06:18 +01:00
parent 9db0056c5d
commit c09dfd1e7b
8 changed files with 404 additions and 53 deletions

View File

@@ -1267,6 +1267,8 @@ public partial class PlayerController : CharacterBody3D,
_currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
if (MantleSystem.IsMantlePossible && IsPlayerInputtingForward())
_playerState.SendEvent("mantle");
if (isOnFloorCustom())
_playerState.SendEvent("grounded");
if (!WallHugSystem.IsWallHugging())
@@ -1286,23 +1288,23 @@ public partial class PlayerController : CharacterBody3D,
{
var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero);
var isIndeedWall = wallNormal.Y < 0.1;
var isThereInput = GetMoveInput().Length() > Mathf.Epsilon;
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
var hvelProjected = hvel.Slide(_wallHugStartNormal);
var haveEnoughSpeed = Velocity.Length() > WallRunSpeedThreshold;
var isCoplanarEnough = Velocity.AngleTo(wallNormal) > Math.PI/4 && Velocity.AngleTo(wallNormal) < 3*Math.PI/4;
var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI/4;
var isLookingInDirectionOfRun = hvelProjected.AngleTo(-HeadSystem.GetForwardHorizontalVector()) < Math.PI/2;
var shouldStart = haveEnoughSpeed && !isGoingDownwards && isIndeedWall && isCoplanarEnough && isLookingInDirectionOfRun;
var hvelProjected = Velocity.Slide(_wallHugStartNormal);
var haveEnoughSpeed = hvelProjected.Length() > WallRunSpeedThreshold;
var isCoplanarEnough = Math.Abs(Velocity.Dot(wallNormal)) < 0.3;
var isGoingDownwards = Velocity.Dot(Vector3.Down) > 0.9;
var isLookingInDirectionOfRun = true; // hvelProjected.Dot(-HeadSystem.GetForwardHorizontalVector()) > 0.5;
var shouldStart = haveEnoughSpeed && isThereInput && !isGoingDownwards && isIndeedWall && isCoplanarEnough && isLookingInDirectionOfRun;
var debugText = "--------------\n";
debugText += shouldStart ? "WALL RUN STARTED\n" : "NO WALL RUN\n";
debugText += $"Enough speed? {haveEnoughSpeed}\n";
debugText += $"Coplanar enough? {isCoplanarEnough}\n";
debugText += $"Going downwards? {isGoingDownwards} with angle {Velocity.AngleTo(Vector3.Down)}\n";
debugText += $"Is looking in direction of run? {isLookingInDirectionOfRun} with angle {hvelProjected.AngleTo(-HeadSystem.GetForwardHorizontalVector())}\n";
debugText += $"HVelocity on wall: {hvelProjected} - Forward H Vector: {-HeadSystem.GetForwardHorizontalVector()}\n";
debugText += $"Going downwards? {isGoingDownwards}\n";
debugText += $"Is looking in direction of run? {isLookingInDirectionOfRun}\n";
debugText += "--------------\n";
//GD.Print(debugText);
GD.Print(debugText);
return shouldStart;
}
@@ -1524,6 +1526,10 @@ public partial class PlayerController : CharacterBody3D,
// SimpleDashInDirection(directionHorizontal.Normalized());
SetVelocity(directionHorizontal.Normalized() * _velocityOnMantleStarted.Length());
}
else
{
SetVelocity(Vector3.Zero);
}
_customMantle = false;
_playerState.SendEvent("grounded");
@@ -2053,6 +2059,8 @@ public partial class PlayerController : CharacterBody3D,
}
public void DashToPlantedWeaponTweenEnded()
{
HeadSystem.ResetHeadBobbing();
// Store the weapon state before resetting it
var isPlantedOnWall = WeaponSystem.IsPlantedInWall();
var isPlantedUnderPlatform = WeaponSystem.IsPlantedUnderPlatform();