The Basics of OnTriggerEnter, OnTriggerStay, & OnTriggerExit in Unity C#

preview_player
Показать описание
In this Unity C# tutorial, I teach you guys the basics of the OnTriggerEnter, OnTriggerStay, and OnTriggerExit voids.

#Unity #Unity3D #gamedev

*Example script will be in pinned comment.*

For more Unity tutorials like this or more videos in general - be sure to like, comment, and subscribe for more! 👍

Play Mooshie's Kitchen 2:

Wishlist Bodhi 'n' Friends on Steam now:

Follow me on Twitter:

Try out my games:

My Website:

Subscribe to my Second Channel:

Join my Discord:

Facebook Page:
Рекомендации по теме
Комментарии
Автор

Example script I made for the video:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class onTrigger : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("entered trigger");
}
}
void OnTriggerStay(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("staying in trigger");
}
}
void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("exited trigger");
}
}
}

Omogonix
Автор

This video was a huge help for the game I'm working on. Thank you!!

QueSo_Studios
Автор

That’s a good tutorial, i think you should make a c# tutorial series for beginner
Because your c# script is not complicated than any Unity tutorial videos so i suggested that :)

Pavel-juxv
Автор

Is there going to be a tutorial of for the gun you can shoot the ground to get extra hight

kingiwakes_official
Автор

You can make a climbing Ladders system???

Alex_xx-lgcj