Add player health system

This commit is contained in:
2024-10-19 19:02:56 -07:00
parent de624d838f
commit 643070aefb
88 changed files with 61848 additions and 187 deletions

17
Assets/healthIndicator.cs Normal file
View File

@@ -0,0 +1,17 @@
using UnityEngine;
public class healthIndicator : MonoBehaviour
{
GameObject player;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
player = GameObject.FindGameObjectWithTag("Player");
}
// Update is called once per frame
void Update()
{
GetComponent<TMPro.TMP_Text>().text = "Health: "+player.GetComponent<Teo>().health.ToString()+"/100";
}
}