Skip to content

Instantly share code, notes, and snippets.

@HectorPulido
Created April 28, 2018 23:19
Show Gist options
  • Save HectorPulido/96b5cee256a4ee587fad85b126f36eed to your computer and use it in GitHub Desktop.
Save HectorPulido/96b5cee256a4ee587fad85b126f36eed to your computer and use it in GitHub Desktop.
public bool IsGround
{
get
{
if(JumpingAttack)
return false;
var cc = Physics2D.BoxCast(groundCheckPosition.position, groundCheckSize,0, Vector2.up);
if (cc == null)
return false;
if (cc.collider == null)
return false;
if (cc.collider.gameObject == gameObject)
return false;
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment