Files
GameJam2023/Enemies/Attacks/EnemyBullet.cs
2023-09-11 17:42:11 -07:00

18 lines
390 B
C#

using Godot;
public partial class EnemyBullet : Projectile
{
public new void OnProjectileHit(Node node)
{
SetPhysicsProcess(false);
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
{
GD.Print("Player hit: " + character.Name);
character.Call(Character.MethodName.OnHit, this);
}
QueueFree();
}
}