RaycastHit RaycastFromCenter()
{
// Determine if we hit anything
Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));
RaycastHit hit;
if (Physics.Raycast (ray, out hit))
{
return hit;
}
else
{
return null;
}
}
Created
February 8, 2016 21:53
-
-
Save Ashwinning/9b8793246f3cc9147d52 to your computer and use it in GitHub Desktop.
Raycast from center : re
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment