holopy3/Assets/Scripts/RingCatcher.cs
2020-12-10 15:25:12 +01:00

17 lines
411 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RingCatcher : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Ring"))
{
AudioSource source = other.gameObject.GetComponentInParent<AudioSource>();
source.Play();
Destroy(other.gameObject);
}
}
}