Skip to content

Instantly share code, notes, and snippets.

@markusrt
Created July 24, 2012 19:51
Show Gist options
  • Select an option

  • Save markusrt/3172215 to your computer and use it in GitHub Desktop.

Select an option

Save markusrt/3172215 to your computer and use it in GitHub Desktop.
Unity: Check if player stopped falling and position on ground
if (Physics.Raycast(new Vector3(thisTransform.position.x-0.3f,thisTransform.position.y,thisTransform.position.z+1f), -Vector3.up, out hit, 0.7f, groundMask) || Physics.Raycast(new Vector3(thisTransform.position.x+0.3f,thisTransform.position.y,thisTransform.position.z+1f), -Vector3.up, out hit, 0.7f, groundMask))
{
xa.falling = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment