There is a prefab button. It is necessary that this button appears in the interface when the character interacts with the object, for example, when selecting an object. The question is how to display this button?

    2 answers 2

    As the most obvious option, do this: create a button on the stage in advance ( Game Object/UI/Button or for some Add Component/UI/Button object), set it up as you need, and then turn it off right in the Inspector window , there is a check mark to the left
    Then, at the right moment you turn it on, i.e. in your case, it is in the appropriate class method (for example, for contacting void OnTriggerEnter(Collider collideObject) , which is located in the script void OnTriggerEnter(Collider collideObject) to this object, to do something in the spirit (well, or not to make Find in advance, make sure that the link Well, this button already had an object, whose method will be called):

     GameObject.Find("YourButtonGameObjectName").SetActive(false); 

      If specifically "Creation", then so:

       T obj = Instantiate(prefab) as T; obj.transform.SetParent(parent, false);