Ability for enemies to shoot when controlled

This commit is contained in:
Marco 2025-02-25 17:29:24 +01:00
commit 2d6bcc5f00
10 changed files with 93 additions and 34 deletions

View file

@ -17,6 +17,8 @@ public partial class ActorFreeMovement : MovementHandler
set => _parent.MovementDirection = value;
}
[Export] public string StrafeAction { get; private set; } = "strafe";
public bool IsDestroyed => _parent.IsDestroyed;
public override void Init(Actor parent)
@ -39,7 +41,7 @@ public partial class ActorFreeMovement : MovementHandler
MovementDirection = AggregateInputProviders().Normalized();
var aimingDirection = GetAimingDirection().Normalized();
var isStrafing = GetStrafing();
var isStrafing = GetActionPressed(StrafeAction);
if (!isStrafing && aimingDirection.Length() > 0.1f)
{