Created
January 9, 2019 16:54
-
-
Save nurcinozer/0f5ffaefd7f4ac20f5d1788321d5ec03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool isgrounded = true; //let's assume he's on the ground | |
void oncollisionstay (collision other) | |
{ | |
if (other.name != "ground") //let's assume the name of the ground object is ground | |
{ | |
isgrounded = false; | |
if (isgrounded = false && other.name != "ground") | |
{ | |
//disable the jumping and wait for when the player is on the ground again | |
if (other.name == "ground") | |
{ | |
isgrounded = true; //add the jumping mechanic back in | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment