On Trigger Start / Stay / Exit [Tutorial][C#] - Unity 3d

preview_player
Показать описание
In this video, we learn how to use the infamous OnTrigger callback from unity. OnTriggerStart, OnTriggerStay and OnTriggerExit

►-------------------------------------------------------◄
Join the community, keep on learning.

► Come hang out in discord! This is the most efficient way to reach not only the team members but thousands of other developers like you! We love it when you help, showcase or just discuss with each other in discord!

► Learn about unity and game design with this playlist:

► If you enjoy what I do here and would like to support me, pledge any amount on Patreon.

►-------------------------------------------------------◄
Stay up to date!

N3K is friendly, laidback community that helps you create video games, and make friends while doing so. Check out our website to learn more, or join us on discord!

► Keep up to date with our plans! Follow the Facebook page

►-------------------------------------------------------◄
More content!

Do you need some ideas?
Try out our Unity Training playlist!

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

thank you you explained this very well and solved the multiple instances of triggers that went loop because, I had the OnEnter and OnExit on the same collide.

howtheuniverseworkslivecha
Автор

Thank you. That was a good demonstration on the differences between these trigger events.

LupusTerre
Автор

Great tutorial man ! really appreciated ! Keep up your great work

dhidavidhuys
Автор

Nice tutorial, the example was very illustrative thanks!

OreoCokes
Автор

This is a very very good video, it is to the point and no BS trying to show off. lift volume about 12 db if anyone sees this b4 watching

gmunay
Автор

OnTriggerStay() that's what I needed! I had two weapons both with OnTriggerEnter/Exit functions that enable/disable a Boolean variable on the player when they are within the pickup trigger. Once I was within both weapon pickup triggers, if I picked up one weapon, that would disable the "playerInWeaponTrigger" variable although I was still within the 2nd weapon trigger....so yeah the OnTriggerStay() helped heaps thanks!

aussieraver
Автор

Everything is working, no issues using Unity 2018.1.4f1. Very instructive, good job! (... perhaps I try to return with my FPC. But then I have to control the coordinates of the Move Platform or something else ...)

AKSenor
Автор

Thank you so much! i needed help with this

jamershun
Автор

Veru HelpFul Tutorial Sir
Much Love to You!

smitj
Автор

awesome video!! thank you so much!!!! :)

chills_
Автор

OMG your explained is very nice and easy
I Love you Channel and I will subscribe
D-:

scortcher
Автор

how the proper syntax to force the trigger to react a specific tag would be?

MuskaKillz
Автор

Hey I have a question. How does it work if I want to trigger something when multiple GameObjects exit/enter a collider. For example I want that sound triggers only once when all GameObjects entered a place.

MrDirtyCraft
Автор

halo Nek, if we want to make the object show smooth, what should we add to the script ?

syarifnm
Автор

does it work for 2D a s well? platform does not show up for me :(

SiriGull
Автор

How do I use a trigger to return a game piece to a specific spot, like a puck to a faceoff circle?

kingdom
Автор

does this work if we use empty gameobjects instead of cubes as triggers??

psychoboy
Автор

The simplest of things can teach someone to do so many things.

tetvris
Автор

I need a little help, when I untick the Move Platform and then press play to see if the trigger works. My 'unticked' platform is there even though I unticked it. Has anyone else experienced this? If anyone responds, a big thanks in advance.

rmunoz
Автор

Hello, is it ok if I put a game object instead of a cube?

alvarocerquininfante