public GameObject canvas;
Ontrigger içi {
canvas.setActive(true);
}
Canvas yok diye bir hata vermez,acaba compenente mi erişmeye çalışıyorsunuz?
KodunuZu atar mısınız?
(Telden yazdım)
public Canvas canvas;
private void Start() {
canvas = GetComponent<Canvas>();
}
private void OnTriggerStay(Collider other)
{
if (other.gameObject.tag == "Player")
{
canvas.enabled = true;
}
else
{
canvas.enabled = false;
}
}aldığım hata MissingComponentException: There is no 'Canvas' attached to the "Gun Collider" game object, but a script is trying to access it.