19 lines
421 B
C#
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();
|
|
}
|
|
}
|