About the use of unity collision detectors

Source: Internet
Author: User

Today is the third time I have forgotten the use of these two collision detection, confused. Deliberately tidy up

First, list out what's involved today.

Collision Method:

Oncollisionenter (collision2d collision)

Oncollisionexit (collision2d collision)

Oncollisionstay (collision2d collision)

Ontriggerenter (collider2d collision)

Ontriggerexit (collider2d collision)

Ontriggerstay (collider2d collision)

The components involved:

Rigidbody-iskinematic

Colider-istrigger

All right, let's analyze it.

The above 6 methods of Enter Exit stay these three kinds of good understanding, the first is to enter the time to trigger, the second is to leave the time to start, the third is to stay inside the time of the trigger.

Well, that's a good understanding, so we're going to analyze things.

Oncollisionenter (collision2d collision)

Ontriggerenter (collider2d collision)

Which of these two methods is triggered in different states.

Okay, let's start the test.

About the use of unity collision detectors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.