mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 12:23:47 +00:00
Ability for enemies to shoot when controlled
This commit is contained in:
parent
dfd9abe91b
commit
2d6bcc5f00
10 changed files with 93 additions and 34 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue