I’m creating my first game in Blender, nothing serious, but I have a cube here that jumps along other cubes.
And I have the jumping set up with a sensor for if the player cube is touching objects with the property “prop.floor” and a sensor for if the keyboard’s spacebar is being pressed, then those two go to an and controller, which goes to an actuator for simple motion to increase the Z force by 159.7
The problem I’m having is that when the player cube is touching two objects that have the “prop.floor” property, the player cube shoots into the air. It happens particularly when it’s touching the side of a cube and a cube below it.
Is there a way I can make the prop.floor property only work on one face of the cube? Or is there any other workarounds?
Hi,
You can use a Ray Sensor pointing down, like in the example above, but you can also use a simple designated “Sensor” object parented below your player to detect the ground.
I would also recommend enabling the “Tap” mode on the keyboard sensor to avoid continuous jumping.
This will send only one pulse to the controller, instead of multiple pulses until you release the key. That was one of the reasons why your cube was flying away.
Hope that helps,
Made a little example using a ground sensor object