Search Unity

Question Manipulating collision behavior while collision starts happening

Discussion in 'Physics' started by artyomich365, May 24, 2023.

  1. artyomich365

    artyomich365

    Joined:
    Apr 27, 2019
    Posts:
    1
    Hello, i searched a lot and decided to write question myself. In my game i want to make bullets pass through if some critical chance happened and stop if not.

    For now im using OnCollitionEnter2D in my bullet to call event that makes another object to do some business logic(for example take critical chance odd, deal damage to target) and delete bullet.

    So for me it would be cool to have an ability to detect collision, make callback to my another object and decide to pass my object through(maybe ignore collision) or stop/delete.