Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity c# on trigger

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TriggerTester : MonoBehaviour
{
    private void OnTriggerEnter(Collider other)
    {
        Debug.LogFormat("{0} trigger enter: {1}", this, other);
    }
    private void OnTriggerStay(Collider other)
    {
        Debug.LogFormat("{0} trigger stay: {1}", this, other);
    }
    private void OnTriggerExit(Collider other)
    {
        Debug.LogFormat("{0} trigger exit: {1}", this, other);
    }
}
Source by www.patrykgalach.com #
 
PREVIOUS NEXT
Tagged: #unity #trigger
ADD COMMENT
Topic
Name
9+7 =