Answers for "Unity mousetoterrainposition"

C#
0

Unity mousetoterrainposition

public static Vector3 MouseToTerrainPosition()
    {
        Vector3 position = Vector3.zero;
        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out RaycastHit info, 100, LayerMask.GetMask("Level")))
            position = info.point;
        return position;
    }
Posted by: Guest on January-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language