G
G
greedile2021-03-31 12:43:39
Unity
greedile, 2021-03-31 12:43:39

How to hide/show object on UI button click?

I have a "Shop" in my game on Unity, in it you can buy a "card", when you buy it, it turns out to be in your hands. How can I make it so that it can be hidden and shown?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WasTabon, 2021-03-31
@greedile

[SerializeField]
private GameObject card; // твоя карта

public void BuyACard()
{
    card.SetActive(true);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question