I have a game object with the following script attached:
var q: GameObject;
function Start () {
q = GameObject.Find("QuestWrapper");
print("test");
}
function OnMouseDown(){
print("mouse click works");
q.SetActive(true);
}
However when I run the scene and try to click on an object, it won’t work. The object desn’t react to mouse clisk. Are there any game object prerequisites in order for this to work?
However the game object is not being assigned to variable in the folowing line.This is different isue but still, I would apreciate any help with this.
q = GameObject.Find("QuestWrapper");
It is null for some reason. This game object is disabled and I need to enamble it. Any ideas? The object I am trying to access is actualy UI image. Could this be an isue?