unity 3d student

Beginner B13 – Trigger Collision Detection

How to detect collisions between objects invisible to the player by using intangible trigger colliders.

Code Used (Javascript)

function OnTriggerEnter (myTrigger : Collider) {
  1.  if(myTrigger.gameObject.name == "box"){
  2.   Debug.Log("Box went through!");
  3.  }
  4. }

Further Reading

Share via Social Media

  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites

16 Comments