So my problem is that I need to detect if a key is pressed inside a trigger area, ‘hotspot’ and then do a GUI animation.
So the way I have it set up at the moment is ‘OnGUI’ because that appears to be the only way to call GUI functions, so how do I say for example: OnGUI, if keypressed and the trigger is initiated?Just seems like I am missing some fundemental information here.
function OnGUI () {
GUILayout.Label (“You are in a hotspot, Press E”);
if (Event.current.Equals (Event.KeyboardEvent (“[E]”)))
//do something here
}
Where would the trigger go?