What is the problem with this code?
public class Healthbar : MonoBehaviour
{
[SerializeField] private Health playerHealth;
[SerializeField] private Image totalhealthBar;
[SerializeField] private Image currenthealthBar;
private void Start()
{
totalhealthBar.fillAmount = playerHealth.currentHealth / 10;
}
private void Update()
{
currenthealthBar.fillAmount = playerHealth.currentHealth / 10;
}
}
This is the error: The type or namespace name ‘Image’ could not be found (are you missing a using directive or an assembly reference?)