Hi guys,
im only new so go easy ![]()
i have a box that opens upon a left mouse click, however it opens even when my mouse is off my object, how can i attach it to my main 3D object only?
this is the code i have so far:
function playMe () {
animation.Play("open");
}
function OnGUI() {
var e : Event = Event.current;
if(e.button == 0 e.isMouse){
Debug.Log("Left Click");
playMe();
}
}
please help, ive been tearing my hair out for hours!!