Wednesday, September 24, 2014

Is Trigger and OnTriggerEnter(), Destroy()

1. Trigger:

  • If two objects are both added Collider component and at least one of them is checked the "Is Trigger" attribute, then OnTriggerEnter() can be used in anyone.


  • Trigger can go into the object.
2. Destroy():

Destroy(gameObject);
Destroy(gameObject, 2.0f); //delay 2 seconds

No comments:

Post a Comment