- Home /
Question by
farahnajwa30 · May 19 at 07:26 AM ·
buttonselection
Multi Select Button
Hi, I've been working on some quiz game. I have 10 answers (button). Users are required to select at least two buttons. And the selected button will determine whether it's right or wrong.
I've tried using this script but not applied when both are selected. I need to make 'RIGHTANSWER' panel shown after button 2 and button 7 are selected. I've bee looking around the solution but didn't found it. So, any idea i would be appreciate so much.. TQ
void Start()
{
btn_2.onClick.AddListener(TaskOnClick);
btn_7.onClick.AddListener(TaskOnClick);
}
void TaskOnClick()
{
if (Input.GetButtonDown("btn_2") && Input.GetButtonDown("btn_7"))
{
RIGHTANSWER.SetActive(true);
}
else
{
return;
}
}
untitled-1-01-min.jpg
(447.0 kB)
Comment