Search Unity

  1. 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

Raycast hit convert code in Raycast2D

Discussion in 'Editor & General Support' started by roshan090, Jun 18, 2019.

  1. roshan090

    roshan090

    Joined:
    Mar 20, 2018
    Posts:
    30
    i am not very good in raycast. can someone please help me to convert these line of code in 2D

    RaycastHit hit;
    if (Physics.Raycast(transform.position, direction, out hit, 100f))
    {
    nextCollisionPosition = hit.point;
    Debug.Log(hit.collider.name);
    }
     
unityunity