Hi im making my first 2d platformer following a tutorial. i made a healthUI using similar heart system to Zelda hearts. I finished my script for both player and the health HUD and im getting this error: Assets/Scripts/HUD.cs(21,25): error CS0029: Cannot implicitly convert type `Sprite' to `UnityEngine.Sprite' this is my code: using UnityEngine; using System.Collections; using UnityEngine.UI; public class HUD : MonoBehaviour { public Sprite[] HeartSprites; public Image HeartUI; public GameObject player; void Start() { player.GetComponent<Player>(); } void Update() { HeartUI.sprite = HeartSprites [player.GetComponent<Player> ().curHealth]; } } please help i really want to keep learning
Things you need to do Don't use caps in the titles. Put your codes into code tags (under insert on the comment toolbar) Import UnityEngine.Sprite