Answer by Cepheid · Apr 17, 2016 at 10:02 PM
Hi There @Hajamat
Y'know, in times like these it's really best to go and consult the Scripting API provided by Unity themselves. Especially if you're new to the engine and programming in general. So, I'll paste the links to relevant pages in the scripting API below.
OnTriggerEnter - Scripting API
OnCollisionEnter - Scripting API
Now, as for the question. The difference between the OnTriggerEnter method and the OnCollisionEnter method is stated in their names.
OnTriggerEnter - Is called whenever an object with a collider has passed through an object with an "isTrigger" checked collider. For example, if you were to make a box trigger and the player walked through it, that would fire the OnTriggerEnter method on that object.
OnCollisionEnter - Is called whenever an object with a collider has collided with another object that contains a collider. For example, if two cars were to crash into one another, that would fire the OnCollisionEnter method on both of those objects.
I hope this helps! :)
What if player meet the box and the box dissapear? can i use trigger or collision?
I would go for a trigger, since you just want it to disappear. But both can be used. It also depends on how you setup your GameObject. If it shouldn't be affected by physics then go for trigger, otherwise it should be handled as collision.
Answer by ThePeat · Apr 10, 2018 at 10:13 PM
A collision also contains information about physics and affects the physics (like mentioned car crash), while a trigger won't affect physics directly and can be handled like an event (in instance when the player reached a certain point xyz shall happen).