removing broken ABC and refactoring enemy movement
All checks were successful
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 / Export (push) Successful in 10m2s

This commit is contained in:
2026-01-17 19:55:51 +01:00
parent f7705a6d57
commit 7c74b8b5e5
24 changed files with 211 additions and 286 deletions

View File

@@ -0,0 +1,33 @@
using Godot;
using Movementtests.interfaces;
namespace Movementtests.scenes.movement;
public partial class CGroundedMovement : Node3D, IMoveable
{
[Export] public RMovement RMovement;
[Export]
public RayCast3D WallInFrontRayCast { get; set; }
public new Vector3 ComputeVelocity(MovementInputs inputs)
{
var velocity = inputs.Velocity;
var target = inputs.TargetLocation;
var direction = (target - GlobalPosition).Normalized();
var targetPlane = new Vector3(target.X, GlobalPosition.Y, target.Z);
LookAt(targetPlane);
velocity.X = direction.X * RMovement.Speed;
velocity.Z = direction.Z * RMovement.Speed;
if (WallInFrontRayCast.IsColliding())
velocity.Y = RMovement.Speed;
else if (!inputs.isOnFloor)
velocity += inputs.gravity * (float)inputs.delta;
return velocity;
}
}