This is what i got.
Its for a key that goes into a collider then plays a animation.
using UnityEngine;
using System.Collections;
public class Keyandlock : MonoBehaviour
{
void OnTriggErenter(Collider other)
{
if (other.gameObject.tag == "Key")
{
Debug.Log("Detected");
}
}
}