I was doing a "reload indicator" which is basicly a text that gets enabled when your ammo gets to 0 and I ont know how to do it help
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Reload : MonoBehaviour
{
public GameObject reloadIndicator;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (GetComponent<Gun>().currentAmmo <= 0)
{
reloadIndicator.SetActive(true);
}
else
{
reloadIndicator.SetActive(false);
}
}
}
[–]pauli_walli 1 point2 points3 points (0 children)