Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************
- // Author: The Messy Coder
- // Date: January 2022
- // For this video review: https://youtu.be/d8Oe1ydME7E
- // Please support by following on Twitch & social media
- // Twitch: www.Twitch.tv/TheMessyCoder
- // YouTube: www.YouTube.com/TheMessyCoder
- // Facebook: www.Facebook.com/TheMessyCoder
- // Twitter: www.Twitter.com/TheMessyCoder
- *****************************************************/
- using UnityEngine;
- using UnityEngine.Events;
- namespace Messy
- {
- public class Trigger : MonoBehaviour
- {
- public string checkTag = "Player";
- public UnityEvent onTrigger;
- void OnTriggerEnter(Collider col)
- {
- if (col.gameObject.tag == (checkTag))
- {
- onTrigger.Invoke();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment