OnTriggerEvent doesn't work
Hi, I'm following the Unity Tutorial: link:text
I'm trying to make a cube being destroyed when other object collides with it. But I don't know why, nothing happens.
This is the setting for the cube, and the attached script. Where is the mistake? I'm totally new on this.
Thank in advance!!
Answer by OncaLupe · Nov 28, 2015 at 09:37 PM
Two errors: The method is 'OnTriggerEnter' (notice the capital O), and the parameter is of type 'Collider' (Collision is for OnCollisionEnter). It should look like this:
void OnTriggerEnter(Collider col)
http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612050554im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
OnTriggerEnter is not called 1 Answer
Trigger not detected 0 Answers
OnTrigger Problems Between Colliders Issue 1 Answer
OnTriggerEnter no longer works 1 Answer
Cant walk through Trigger. 0 Answers