2
$\begingroup$

My main goal is to have the best jumping experience - (Keep jumping up and down when spacebar is held down, longer jumps when spacebar is held longer), where there is no wall jumps.

Currently, minus a few features I kinda wanted to have, you can only jump (With the Force Motion) only when the spacebar is pressed, in a collision with an object (Walls too). This creates the ability to wall jump, which I do not want. Removing the Collision sensor makes things worse, where you can keep jumping in the air to space.

enter image description here

My question is, how do I use the collision sensor (if it's a good way), and to detect/prevent the player from jumping up walls?

$\endgroup$
  • $\begingroup$ Check my edited answer, there is the blend to download. $\endgroup$ – Strapicarus Dec 25 '17 at 14:23
2
$\begingroup$

enter image description here

First your problem was that you set the ray sensor range to a kilometers (100000.00), set it to 1 or 2 (1.00), also there is no objects with "walls" propety in your file and the ray should look for ground, i set the higer floating ground to wall and you not able to jump over it, the other i change from ground to floatingGround property so this way the ray's and collisions sensors will not add 2 times the force of jumping when the player is over 2 grounds and add another set of ray and collitions sensors and motion actuator to jump over the floating grounds.

Before edit

Use a ray sensor property ground combined with the kerboard sensor and collision sensor property wall.
enter image description here

PD. Its late here and this gif take to much lol.

$\endgroup$
  • $\begingroup$ I set it up like you have shown, but for some reason, the Ray sensor is preventing jumping. Also, does this work if I want a cube where it's sides are walls, and the top is ground? $\endgroup$ – Akados Dec 22 '17 at 4:20
  • $\begingroup$ Increese the range distance, the idea is that when the player jump and it higher than the range in the ray sensor the player will just fall, also make sure that the axis is -z (negative) in the ray sensor. $\endgroup$ – Strapicarus Dec 22 '17 at 17:51
  • $\begingroup$ In test that i made the ground is below the player and was able to jump higer and able to make doble jump. if you want doble ground over and below the player all you doing is wrong, firts the player will need to be not affected by the world gravity and need to set some sort of doble gravity from the 2 grounds for that the player physics should be static and you need to calculate the forces applies and update the player position with thats calculations. $\endgroup$ – Strapicarus Dec 22 '17 at 17:51
  • $\begingroup$ What way do you recommend to create a jumping thing like this, that will not double jump, and will not jump off of walls? $\endgroup$ – Akados Dec 22 '17 at 19:09
  • 1
    $\begingroup$ Those 3 points is to activate "true level triggering", which means that the sensor will run every frame, if not checked the sensor only run the first frame. $\endgroup$ – Strapicarus Dec 25 '17 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.