Skip to content

Instantly share code, notes, and snippets.

@markusrt
Created September 25, 2012 20:09
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 markusrt/3784133 to your computer and use it in GitHub Desktop.
Save markusrt/3784133 to your computer and use it in GitHub Desktop.
Unity: Detect collision above
var collisionAbove = ((controller.collisionFlags & CollisionFlags.Above) != 0);
if(collisionAbove)
{
if(movement.verticalSpeed>0)
{
movement.verticalSpeed = -1 * movement.verticalSpeed/-2.0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment