Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Documentation for GraphicRaycaster in Unity 2020.x series is not clear ...

Discussion in 'Documentation' started by rktumuluri63, Oct 27, 2020.

  1. rktumuluri63

    rktumuluri63

    Joined:
    Jun 18, 2020
    Posts:
    15
    Hi,

    In past versions of Unity (2017 ... 2019) documentation for GraphicRaycaster class was clearly visible within the "Scripting API" section.

    However for Unity 2020.x it is not clear. Pls advice.

    Code containing GraphicRaycaster.Raycast is working. A new "Canvas" object in the Unity Editor brings up the component "Graphic Raycaster" by default. Yet in the "manual" the "Graphic Raycaster" component is not described although other components of "Canvas" have been.

    Regards
    /rk
     
  2. jamesb-unity

    jamesb-unity

    Unity Technologies

    Joined:
    Oct 8, 2020
    Posts:
    5
    Hi rk,

    So as of 2020.x, the GraphicRaycaster class has been moved into the Unity UI package. You can find the package here:
    https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/index.html

    and the specific manual page for GraphicRaycaster here:
    https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-GraphicRaycaster.html?q=raycast

    The Scripting API entry for GraphicRaycaster is also in the package docs here:
    https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.UI.GraphicRaycaster.html

    Your code still works because Unity UI is a builtin package and gets installed as part of the normal Unity installation process. We'll add a note to the 2018 and 2019 versions of the docs to communicate where this has moved to in the later version.

    Hopefully this has cleared things up a little for you, thanks for giving us this feedback!
     
unityunity