Originally Posted by
Oracle
That's a pretty overkill way to implement jumping. You could have just assigned all your floor game objects on a layer, then used "isTouchingLayer" (or something along those lines) for your boolean check. Also, using your way, a player could, theoretically, never touch the ground again since the jump is tied to distance being smaller than or equal to a number that isn't equal to 0, or jump off objects that you aren't intended to be able to jump off of.
isGrounded is intended to check if your character is in a stable position. This is to prevent, for example, a player from spamming jump up an incline that should be too steep to travel.
? I really don't understand this at all. It's a proper method that works 110% of the time for what I need.. This method works for people who want the player to be able to jump off of anything, NOT just things with a specific layer. If my player manages to jump on top of a car, then wtf happens? I can't put the car on the ground layer, because it isn't the ground. He can't jump off it which is ass. but using this raycast, it doesn't matter what he is on, he can still jump.