Files
GameJam2023/Enemies/Scripts/GodCircuit.cs
2023-09-06 03:49:16 -07:00

15 lines
325 B
C#

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