Home > Back-end >  instantiate gameobject then show ui
instantiate gameobject then show ui

Time:05-09

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?

CodePudding user response:

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

  • Related