Image activating at the start of the scene
I’m trying to make a store where when you get close to your door, an image will pop up asking if you’d like to enter the store. This image is activating at the beginning of the scene though. Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class imbluedabeedabade : MonoBehaviour
{
public Image WYL;
private void Start()
{
WYL.gameObject.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
WYL.gameObject.SetActive(true);
}
private void OnTriggerExit(Collider other)
{
WYL.gameObject.SetActive(false);
}
}
The reason why I am using SetActive is because the image contains texts and buttons as children.