Files
GameJam2023/Enemies/Scripts/GodCircuit.cs
2023-09-08 01:34:37 -07:00

19 lines
421 B
C#

using Godot;
public partial class GodCircuit : Node3D
{
[Export]
private AnimationPlayer _animationPlayer;
private void OnHit(Node3D node)
{
GD.Print("Hit");
_animationPlayer.Play("OnHit");
var hpComponent = GetNode<HealthPoints>("HP Component");
hpComponent.TakeDamage(800000);
hpComponent.UpdateHealthbar();
if (hpComponent.CurrentHP <= 0)
QueueFree();
}
}