Input Mouse?

How to put Mouse click for open a gameobject animation?
The mouse click must touch the GameObject, and then start the animation…
which code i do use?
Sorry for my english! :slight_smile:

HaveClicked.cs ---- C#

using UnityEngine;
using System.Collections;
 
public class HaveClicked : MonoBehaviour 
{ 
	public Animation myAnim; // Define in the Unity Editor
	
	public void OnMouseUp()
	{
			myAnim.Play();
	}
	
}

HaveClicked.js ---- UnityScript

#pragma strict

var myAnim : Animation; // Define in Unity Editor

public void OnMouseUp()
{
		myAnim.Play();
}

This :slight_smile:
Checking if the click hit the object = play animation