UI Interface

Hello! I am trying to create a shop with a UI interface. My problem is when the player enter in the collider of the object (Kiosk) the UI will not pop out. I tried everything I know.

Can you write the correct script for this application or can you tell me what I need to do so the application works?

This is what I am trying to do:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OpenShop : MonoBehaviour
{
    private GameObject shop;

    private void Start()
    {
        shop = GameObject.Find("Background");
        shop.SetActive(false);
    }
    private void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Player")
        {
            shop.SetActive(true);
        }
    }
    private void OnTriggerExit(Collider col)
    {
        if(col.gameObject.tag=="Player")
        {
            shop.SetActive(false);
        }
    }
}

Your code is using GameObject.Find in the wrong way, it will only look at the childrens where the function is called (in your case the childrens ok Kiosk), not at the entire hierarchy!

This is how you should rewrite the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OpenShop : MonoBehaviour
{
    private GameObject shop;

    private void Start()
    {
        //We are first looking for the canvas and then we get the background from it
        //Note that if you have multiple Canvases this could cause a semantic error, you could get the Canvas you don't want here!
        shop = FindAnyObjectByType<Canvas>().gameObject.Find("Background");
        shop.SetActive(false);
    }
    private void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Player")
        {
            shop.SetActive(true);
        }
    }
    private void OnTriggerExit(Collider col)
    {
        if(col.gameObject.tag=="Player")
        {
            shop.SetActive(false);
        }
    }
}