Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug CircleCast with distance set to zero and OverlapCircle methods yield different results

Discussion in 'Physics' started by Crembotz, May 5, 2024.

  1. Crembotz

    Crembotz

    Joined:
    May 12, 2018
    Posts:
    20
    Hi

    In my game, the player is able to throw a hoop that latches onto detected targets.
    I have a target detection system that works by using the `CircleCast` method with a detection distance set by me. If a target is detected, it is highlighted.

    The hoop the player throws is thrown in the direction of the `CircleCast` of the target detector and checks every `FixedUpdate` if it touched any targets using the `OverlapCircle` method and I noticed that sometimes the target detector would detect targets and they would get highlighted but the hoop didn't detected them. After I edited the hoop script and replaced the `OverlapCircle` method with the `CircleCast` method with distance set to 0 everything worked and the hoop detected targets only when the target detector detected them.

    Thank you! :)