Now it says Enemy.CanBeHarmed is not used what is going on here and how do I fix it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField] float EnemyHp = 100f;
[SerializeField] bool CanEnemyBeHarmed;
public void Harm(float HarmHp)
{
if(CanEnemyBeHarmed = true);
{
if(EnemyHp > 0)
{
EnemyHp = EnemyHp - HarmHp;
}
}
}
void Update()
{
if(0 >= EnemyHp);
{
GetComponent(MeshRenderer).enabled = false;
}
}
}
}