Files
MovementTests/scenes/FixedDashTarget/FixedDashthroughTarget.cs
Minimata db49703326
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 22s
Create tag and build when new code gets to main / Export (push) Failing after 1m51s
added fixed dash targets and can dash towards enemies to hit them, get a knockback or dash through if killed
2026-01-21 16:46:20 +01:00

32 lines
703 B
C#

using Godot;
using System;
using Movementtests.interfaces;
[GlobalClass]
public partial class FixedDashthroughTarget : AnimatableBody3D, ITargetable, IStunnable
{
public Vector3 GetTargetGlobalPosition()
{
return GlobalPosition;
}
private uint _defaultCollisionMask;
public override void _Ready()
{
_defaultCollisionMask = CollisionMask;
}
public bool IsStunned { get; set; }
public float StunDuration { get; set; } = 0.1f;
public void Stun()
{
_defaultCollisionMask = 0;
GetTree().CreateTimer(StunDuration).Timeout += Unstun;
}
public void Unstun()
{
_defaultCollisionMask = CollisionMask;
}
}