Im currently working on a Tower defense game. and im using Buttons to place towers. My idea is, when you click a button it will show buttons that is connected to a tower indexes. My question is, if you clicked on the button, how can I show the tower indexes button I made? I dont know the codes to put in script. Please help me Im a real noob at programming and in unity.
Disclaimer: I haven’t really worked with buttons much.
To check if a button has been clicked, use the OnMouseDown() function in a script on the button.
Within that, you can do whatever you need to make the other button visible. First you need to access the other button, for example with FindWithTag() or Find(). Then change whatever is making the object invisible. Enable its image/text component or whatever you have disabled to make it invisible.