X accel + scene gravity = totally random gravity?

williamsonajmwilliamsonajm Member Posts: 12
edited November -1 in Working with GS (Mac)
Hi all,

I'm having a slight issue with my would-be-platformer at the moment. I have the scene gravity set, ad my player 'falls' at one speed. However, if my player is moving left/right with accel then the speed he falls is MUCH faster. Plus if I'm standing still and try and jump, I will only jump Y high. However, again, if I am moving left/right then I will jump MUCH higher (usually off-screen high).

Why is this happening? How can I fix it?

Thanks!

Comments

  • juzcookjuzcook Member Posts: 259
    im working on a puzzle platformer at the moment. through my experience, i never use scene gravity as it can cause too many problems. do you NEED to use accelerate behaviours? im not sure if there's been a very polished platformer from gs yet that uses that method but i could be wrong. if you're open to a different movement style, check out the demo ive got up which involves using linear velocity instead. you can get a nice "rounded" style jump when playing around with that :)
  • ORBZORBZ Member Posts: 1,304
    try this, in real life, if you do a running jump, don't you jump higher?
  • ORBZORBZ Member Posts: 1,304
    `
    -->
    |\
    | \
    \
    `
  • williamsonajmwilliamsonajm Member Posts: 12
    I just quite liked the 'build up' of speed using accel, rather than simply launching out at my full speed straight away by using the velocity behaviour.

    But as for the jumping higher issue, it's just not consistant. One moment I'll jump a normal height, the next I'm launching myself WAY off screen...

    Maybe I'll try velocities instead of accel... Hmm... :-P
  • ORBZORBZ Member Posts: 1,304
    i dunno, i'd have to see your code. it sounds like a bug. are you sure you're not "bouncing" off the ground?
  • williamsonajmwilliamsonajm Member Posts: 12
    Both my player and my ground are very non-bumpy, with their restitution set to 0...?
  • williamsonajmwilliamsonajm Member Posts: 12
    I have actually semi-solved the random jump height issue by accident (I think).

    I had a BOOL value to show if I was allowed to jump (i.e. I'm stood on something). I had two rules; one checking if I was allowed to jump (i.e. the BOOL value), and one checking if the player had pushed a jump button on screen. Previously, I had it checking if I was allowed to jump, and then if a button had been pushed = random jump height. Now I have them the other way around, it seems to be behaving itself. i.e. It now checks if someone has pushed the jump button, and if it has, it checks if the player is currently allowed to jump, and then it goes through the jump animation.

    Anyway, just though I'd share the result...
  • williamsonajmwilliamsonajm Member Posts: 12
    Ok. I stand corrected. I didn't solve it. I can't seem to workout these physics.

    If anyone is will to have a look at my GS file I'd be grateful! :-)
  • williamsonajmwilliamsonajm Member Posts: 12
    bump. :-P
  • ORBZORBZ Member Posts: 1,304
    Send me the project and I'll take a look
  • williamsonajmwilliamsonajm Member Posts: 12
    Sent. Thanks! :-)
Sign In or Register to comment.