fatdrogen
fatdrogen

Reputation: 531

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?

Upvotes: 2

Views: 86

Answers (1)

Winjas Force
Winjas Force

Reputation: 46

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

Upvotes: 1

Related Questions