I'm trying to create a lives system of five hearts in a game I'm making, so to do that I created a life tracked script:
using System.Collections;
using System.Collections.Generic;
using Microsoft.Unity.VisualStudio.Editor;
using UnityEngine;
public class LifeTracker : MonoBehaviour
{
public int lives;
public Image[] hearts;
public Sprite heartImage;
}
However, when I go to Unity, the inspector will only show the int and Sprite:
I've tried rewriting and reloading the script, but nothing's worked. I tried changing it to "public Image[] hearts = new Image[5];" but have had no change.
Where am I going wrong? Does Unity not allow arrays in the inspector anymore? I'm new to Unity, but I'm not that new, and everywhere I look it says that this should work. Am I missing something obvious?
