Refer to question I don’t know what to put here.
Trying to make a buying system to clear doors and buy weapons but can’t get text to appear anyone know the problem?
(There are no errors)
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
//using UnityEngine.;
public class OpenDoor : MonoBehaviour
{ public GameObject Obstacle;
public TextMeshProUGUI buyprompt;
// Start is called before the first frame update
void Start()
{ // buyprompt = Obstacle.AddComponent <TextMeshPro> ();
//buyprompt.activeSelf = false;
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter (Collider other) {
if(other.tag == "Player") {
buyprompt.enabled = true;
}
}
}