Skip to content

Instantly share code, notes, and snippets.

@jquave
Created October 19, 2014 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jquave/a8dc8e91ea268fdeffc5 to your computer and use it in GitHub Desktop.
Save jquave/a8dc8e91ea268fdeffc5 to your computer and use it in GitHub Desktop.
bool Grounded() {
int layerMask = 1 << playerLayerMask;
layerMask = ~layerMask;
RaycastHit hitInfo;
if( Physics.Raycast(transform.position, Vector3.down, out hitInfo, playerHeight, layerMask) ) {
return true;
}
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment