Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback CapsuleCast documentation sample code possibly wrong

Discussion in 'Documentation' started by BakeMyCake, Jan 12, 2021.

  1. BakeMyCake


    May 8, 2017
    This page
    Code reads:

    Vector3 p1 = transform.position + + Vector3.up * -charContr.height * 0.5F;
    Vector3 p2 = p1 + Vector3.up * charContr.height;

    Which does not take into account the capsule radius, so it produces points on the tip of either side of the capsule instead of the center of the spheres that form the sides.
  2. jamesb-unity


    Unity Technologies

    Oct 8, 2020
    Hi, thanks for reporting this. I'll try to find someone who can investigate this issue for you. We are also encouraging users to use the feedback form at the bottom of each page instead of reporting bugs on the forums. If you use the "Report a problem on this page" button to report issues such as broken example code, a support ticket will be automatically be created for the relevant team to investigate.

    This makes it much easier for the relevant technical writers to see when an issue is reported in their area, so it would be great if you could use that to report any future issues you find in the docs. Thank you!
  3. yazoubello


    Jan 5, 2021
    I still prefer services like pastebin because those support syntax highlighting

    Kodi nox
    Last edited: Feb 27, 2021