Click on object to activate another object

Hey guys,I am starting to learn more about unity.

Recently,I made a script that when you go into a trigger,another object activates/gets destroyed.

But I find that boring like you don’t even need to click the mouse.

So i need a script that when you click on a gameobject’s trigger or mesh,another gameobject appears.

Hopefully you can help me by finding a tutorial or a script!

In object A, have this script attached

var object : Transform;
var clicked = false;

function OnMouseEnter () {
clicked = true;
}

function Update () {
if(clicked){
object.GetComponent(OtherScript).activated = true;
}
}

then in the object you want to have activated, attach a script called ‘OtherScript’ which has the variable ‘activated’ in it

public GameObject otherObject;

void OnMouseUp() // mouse click
{
   otherObject.SetActive(true);
}

void OnTriggerEnter() // for trigger
{
   otherObject.SetActive(true);
}