playMaker

Author Topic: Jump problems  (Read 1365 times)

Lainsito

  • Playmaker Newbie
  • *
  • Posts: 1
Jump problems
« on: March 28, 2018, 05:40:49 PM »
Hi guys, Im new over here, using the forums and playmaker, so hi everyone.
My problem is that Im using a Rigidbody (mass 1, dra 0, Angular Drag 0) as a character controller.
And for the jump I use this state machine when the player press the jump button (image attached).
I made that way so you can hold the button to jump higher or lower, at first it seems great but after doing some testing I realize that somentimes my character jumps higher and other times it jumps lower even if I press the button the same amount of time, I tried changing the force mode, the amount of force, the mass... and I dont have a clue why...any sugestions? sorry for my bad english, thanks!
« Last Edit: March 28, 2018, 05:44:52 PM by Lainsito »

Deek

  • Full Member
  • ***
  • Posts: 133
Re: Jump problems
« Reply #1 on: March 29, 2018, 08:15:27 PM »
Some thoughts/suggestions:
- you seem to loop this state through the 'Wait' action every 0.15s, which might be the source for your inconsistent results, try having that action disabled
- you use 'Get Button Up' to detect the key press, which means that it only gets fired when you release the key; you might want to try 'Get Button Down' to fire the moment you press down or use 'Get Button' and check the bool that you get from that in 'Bool Test' every frame if you want your character to only go up as long as that key is pressed
- if the problem has something to do with the physics, try playing around with the mass, drag and angular drag values on the RigidBody to see if it behaves in a more desirable way

Alternatively you could also set your 'Add Force' action to not run every frame,  set its force mode to "Force" or "Impulse" and reduce the Y value until it jumps more naturally. Then you only boost it up once when entering this state instead of constantly applying a change in velocity, which resulsts in inaccurate physics behavior anyway.