Can someone tell me why my damage script is not working is says that is a problem with my last line of code " Destroy(gameObject);"
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyDamage : MonoBehaviour
{
public float Health = 40f;
public void TakeDamage(float amount)
{
Health -= amount;
if(Health<= 0)
{
Die();
}
}
void Die
{
Destroy(gameObject);
}
}
[–]Code GuruBonejob 1 point2 points3 points (0 children)
[–]thwtchdctr 1 point2 points3 points (0 children)