Error CS0104: 'Image' is an ambiguous reference between 'UnityEngine.UI.Image' and 'System.Net.Mime.MediaTypeNames.Image'

Can’t figure out what exactly I need to do.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static System.Net.Mime.MediaTypeNames;

public class HeartController : MonoBehaviour
{
PlayerController player;

private GameObject[] heartContainers;
private Image[] heartFills;
public Transform heartsParent;
public GameObject[] heartContainerPrefab;

// Start is called before the first frame update
void Start()
{
    player = PlayerController.Instance;
    heartContainers = new GameObject[PlayerController.Instance.maxHealth];
    heartFills = new Image[PlayerController.Instance.maxHealth];

}

// Update is called once per frame
void Update()
{
    
}

void SetHeartContainers()
{
    for (int i = 0; i < heartContainers.Length; i++)
    {
        if (i < PlayerController.Instance.maxHealth )
        {
            heartContainers[i].SetActive(true);
        }
        else
        {
            heartContainers[i].SetActive(false);
        }
    }
}

void SetFilledHearts()
{
    for (int i = 0; i < heartFills.Length; i++)
    {
        if (i < PlayerController.Instance.health)
        {
            heartFills[i].fillAmount = 1;
        }
        else
        {
            heartFills[i].fillAmount = 0;
        }
    }
}


void InstantiateHeartContainers()
{
    for (int i = 0; i < PlayerController.Instance.maxHealth; i++)
    {
        GameObject temp = Instantiate(heartContainerPrefab);
        temp.transform.SetParent(heartsParent, false);
        heartContainers[i] = temp;
        heartFills[i] = temp.transform.Find("HeartFill").GetComponent<Image>();
    }
}

}

Remove this from your script.

Then it comes up with (66,31) error CS0311

No one memorises error codes.

Post the code correctly and the full error message.

sorry, it’s just pretty long.
"The Type ‘UnityEngine.GameObject[ ]’ cannot be used as type parameter ‘T’ in the generic type or method ‘Object.Instantiate(T)’. There is no implicit reference conversion from ‘UnityEngine.GameObject[ ]’ to ‘UnityEngine.Object’.

I mean, just read what the error says?

Your heartContainerPrefab field is an array of game objects. Object.Instantiate does not accept an array of game objects.

oh wait I finally found what I did wrong.
public GameObject[ ] heartContainerPrefab; should be public GameObject heartContainerPrefab;
Sorry for wasting your time.