using UnityEngine;
using System.Collections;
public class KeyScript : MonoBehaviour {
public GameObject steeldoor;
public AudioClip keySound;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.layer == 9) {
audio.PlayOneShot(keySound);
Destroy(steeldoor);
//code here for moving the object
}
}
}