playMaker

Author Topic: Awkward Character Jump Fall?  (Read 4177 times)

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Awkward Character Jump Fall?
« on: November 27, 2012, 10:59:22 PM »
Apperently I have a problem here, when I have my player jump (he jumps fine btw, collision wise and everything) it jumps fine, however the gravity is a bit weird. I set the gravity Y to -50 (so the fall won't be so floaty) and the time scale to 2 (the player used to jump up like the moon). But the thing I'm having is that I have problems landing. If I hold the Up arrow he'll jump continuiously, up and down just fine. However if I let go he immedietly falls down due to the gravity. How can I have the player jump up and down at a constant rate without letting go of the Up arrow?

Sorry for my English btw >< Anyway, to put it in basic terms, I want like a Mario jump but since I let go of the Up arrow when he's at his highest he should fall down the same speed as jumping up. If I keep holding the up button that'll do just it but I don't want to do that, if I let go of the Up arrow at its highest point he'll jump down instantly (The gravity is at -50)

In more basic terms, how do I script a proper jump?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Awkward Character Jump Fall?
« Reply #1 on: November 28, 2012, 01:01:27 AM »
hi,

It looks to me as you've lost yourself in physics settings. Maybe you have a drag value to high, Modifying the gravity is generaly a sign that something is wrong elsewhere. Changing the time scale is even more of a desperate move, and certainly to be avoided just for a more realistic jump.

I am not sure I can make sense of what you are trying to achieve, can you rephrase? thanks.

bye,

 Jean

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Awkward Character Jump Fall?
« Reply #2 on: November 28, 2012, 01:10:24 AM »
Me: Holds the Up button
Player jumps at max height and falls correctly, but will keep doing that until let go.
^ That's fine

Me: Presses the Up Button
Player makes a slight jump
^ That's fine

(easier to imagine it in slow mo)
Me: Presses the Up button
Player jumps until reaching its max height (still in mid air)
Me: Lets go of the Up button
Player falls down faster than it should
^ That's not fine

I want the player to fall the same speed as he jumps, but when he doesn't jump and let's say he falls off a platform without jumping, I want him to fall faster (so I made the Gravity Y axis -50)
At first the jump was floaty, so I increased the speed so the player jumps up faster.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Awkward Character Jump Fall?
« Reply #3 on: November 28, 2012, 02:08:59 AM »
Hi,

 I see, It's linked to how to make the player jumps, you are likely applying a force right? you have likely setup the physics to fall under the jumping force, where maybe the right approach would be only apply a jumping force.

Have a look at how I did it for the platform jumper:

The behavior implemented is really what you want I think, when the player touch the ground, you check of the jump input is on, and if so, jump again. Then it will all be simple and consistent.

bye,

 Jean
« Last Edit: November 29, 2012, 10:59:52 AM by jeanfabre »

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Awkward Character Jump Fall?
« Reply #4 on: November 29, 2012, 07:31:06 PM »
Ok well, I added the rigid body, at first it spazzes out so I blocked all rotations, now it could only move X and Y (also disabled the Z axis movement). I replaced the Character Move with Add Force, put in the number 5 in the Y, but now it's not jumping anymore :? The gravity works fine and everything, but it won't jump ><

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Awkward Character Jump Fall?
« Reply #5 on: December 11, 2012, 05:35:35 PM »
Hi,

 you may very well have reseted its speed including the y axis which would result in a no jump.

bye,

 Jean

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Awkward Character Jump Fall?
« Reply #6 on: December 15, 2012, 02:24:38 AM »
Well how exactly would I fix that?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Awkward Character Jump Fall?
« Reply #7 on: December 21, 2012, 03:58:34 AM »
Hi,

 Are you using the platform jumper example as a base?

bye,

 Jean

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Awkward Character Jump Fall?
« Reply #8 on: December 27, 2012, 03:08:50 AM »
Nope, can't find it anywhere. But I managed to fix it (at least a tad bit), I'll just embrace this :P

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Awkward Character Jump Fall?
« Reply #9 on: January 01, 2013, 08:49:33 AM »