so in here there is a box to which i have attaches this script and ATTACH1 is a socket interactor here i want is when the box which i have attaches attaches to that socket interactor the text which is on canvas destroy!! But infortunately this is not working! do you see any issues here or something that u thing is wrong or I missed?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Box1 : MonoBehaviour
{
private GameObject box2;
private Text noBox;
// Start is called before the first frame update
void Start()
{
box2 = GameObject.Find("ATTACH1");
noBox = GameObject.Find("text").GetComponent<Text>();
}
void Update()
{
}
void onTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
Destroy(noBox);
}
}
}