I am making a game/demo thingy and I need to make the character jump.
I already have it so that when the player presses space and is touching an object with a “floor” property I apply upward force. But that doesn’t work so well…
There are some crates and stuff in the game that the player can jump on top of but when you try and jump, you can’t. This is simply because the crates don’t have a “floor” property. But when I give them a floor property, the player can fly up the sides of the crates…
I know that there is a way to check if there is something under the character with a Python script. But I don’t know Python so well…
You could always place invisible planes on top of the cubes with the property “floor”. They probably wouldn’t need to be all that large, depending on the size of your crates of course.
Another idea would be to set a “toggle” property that is only reset when the jump key is released, and attach it to your jump button with “AND” to only trigger when it equals “0”. When it’s activated, set the toggle to “1” along with your jump force. Set a sensor to check for the INV of your jump key and have it set the toggle back to “0”. Keep your floor sensor attached as well, which you can combine with the invisible planes above for the higher accuracy.