- Home /
select game object triggers GUI
I have my level to a point where I can select an object with a click or touch and it will trigger my GUI buttons to appear. From there the user can make a selection. The selection the user will need to make will be to identify the object they have just clicked that triggered the GUI. The GUI buttons should include several wrong options and only one correct answer (the object they chose to trigger the GUI).
Does anyone have an idea of how to approach this?
Answer by Bluestrike · Jun 12, 2012 at 07:38 PM
OnMouseDown() is a function that fires when you click on an object(that has a collider) so you can attach a script to your object that has this OnMouseDown() function that enables the OnGUI() that displays a menu on the screen.
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnMouseDown.html or search for "onmouse" for more options on mouse interaction with objects.
Your answer
Follow this Question
Related Questions
How to make slider load variable on start 1 Answer
Problem Displaying Score on GUI text 0 Answers
Changing variables in GUI? 0 Answers
[Fixed] Unity UI Text Code Reference magically dissapears 1 Answer
How to Update Variable from GUI 1 Answer