Skip to content

Instantly share code, notes, and snippets.

@sylistine
Created December 3, 2015 04:00
Show Gist options
  • Save sylistine/1df4b0ef8153f0d8fc63 to your computer and use it in GitHub Desktop.
Save sylistine/1df4b0ef8153f0d8fc63 to your computer and use it in GitHub Desktop.
float rayDist = 0.1;
RaycastHit hitA, hitB;
hitA = Physics.Raycast(
transform.position + transform.up * rayDist * 2,
transform.forward,
Mathf.Infinity,
layerMask
);
hitB = Physics.RaycastAll(
transform.position + transform.right * rayDist + transform.up * rayDist,
transform.forward,
Mathf.Infinity,
layerMask
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment