Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

Feedback Add a remark for Physics cast methods

Discussion in 'Documentation' started by BakeMyCake, Dec 23, 2020.

  1. BakeMyCake


    May 8, 2017
    I've spent more time than I'd like to admit, debugging a strange case where my BoxCast-dependent code would suddenly teleport objects to the origin of the world. The issue turned out to be an unexpected feature of the API that all functions working with RaycastHit can potentially return 0 as the hit point.

    I believe this is not apparent from the API documentation and should be warned about. I did not find any mention of it in any of the documentation I initially searched:

    The only place I've found, where this is described is here
    After discovering this I was able to locate a lot of forum discussions describing and explaining it in detail, the problem here is that at that point I've already lost time debugging it myself. This is a classic case of something incredibly simple being difficult to discover naturally by virtue of not knowing the magic keywords to type in search beforehand. To save anyone else the trouble I suggest mentioning this nuance in more places in the API documentation to improve user experience.

    As it stands, it seems you can only discover this either by running head-first into the very same issue, or if you happen to be using SphereCastAll specifically.