How to use OnTriggerEnter in C sharp?

Answer this question

  • How to use OnTriggerEnter in C sharp?


Answer #1 | 20/12 2013 06:25
unction OnTriggerEnter (other : Collider) { Destroy(other.gameObject); }
Positive: 21 %
Answer #2 | 20/12 2013 07:08
Looks like you're using Unity, Awesome :) Now before you want to load a scene, you want to check if the player collides with the ground. To trigger the OnCollisionEnter function, you have to make sure that both objects have a collider! Attach the folowing piece of code in a script to the object where the player will be colliding with: void OnCollisionEnter(Collision col) { if( == "") { Application.LoadLevel(""); } } I might have looked over a capital or convertion, but those errors pop up right away and show you exactly what to fix, since I'm on my mobile, and can't test it.Gl in further programming!
Positive: 15 %

Possible answer

How to use C# List Class ... (C) 2016 Founded by raps mk All Rights Reserved. All other trademarks are property of their respective owners. ...
Read more
Positive: 21 %
C# Array Examples Arrays ... We can use array.Length to find the length of an Array. String Array. ... (C) 2016 Founded by raps mk
Read more
Positive: 16 %
Using ActiveX in C#. C# / C Sharp Forums on Bytes. 416,989 Members | 2,451 Online Join Now; login; ... I had to use it to activate someting one time ...
Read more
Positive: 2 %
An easy-to-use example of how to create a DLL library in C and ... of how to create a DLL library in C and then use it ... C-sharp\Enrollment ...
Read more
Positive: 10 %

Show more results