How to make an object clickable so when clicked it displays a pop up? (triva game help..?)

I am currently still learning some scripting since I took a break from it for a LONG time and I barely remember how to do anything…

My objective is to click on a 3D object and then to display a multiple choice question (basically a triva game but in 3D ). How can I make an object clickable so when clicked it displays the question with multiple choices…?
Thank you…! I need help quick, so please help!!

1 Answer

1

see link below;

unity3danswer

its a quote from “Uriel_96” answer in “How To Perform A Mouse Click On Game Object” from “oliver-jones”;

if ( Input.GetMouseButtonDown(0)){ var hit : RaycastHit; var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition); var select = GameObject.FindWithTag("select").transform; if (Physics.Raycast (ray, hit, 100.0)){ select.tag = "none"; hit.collider.transform.tag = "select"; } }

then see , this tutorial from jayanam.

Have a nice day sir/madam.

Thank you! :)

–