'instantiate gameobject then show ui

I try to instantiate a GameObject and then make the button show on the screen, but I found I can't use SetActive(false) and then set true, to show the UI, Because I can't find the false object.

is there a better way to do that?



Solution 1:[1]

I am a little confused.

Remember, that people can't see your screen or what you are doing, so you need to explain it in a lot of detail.

If I read that correctly and think what you see is what I think, then it's this:

  1. You Instantiate a new GameObject
  2. You want a button to be enabled on your canvas

If thats your problem, just do public GameObject buttonOnSpawn and then set it to active

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Winjas Force