Jumping and Side Collisions

I have created an actor and jumping works fine when my actor is on top of a solid. If, however, my actor collides with a solid whilst mid jump, my actor lands and the jump button no longer functions. Is there a way to get my actor to jump again after a mid air collision with a non-moving actor?

My jump is set up like this:

I have added an integer attribute 'Jumps' set to '0'

Actor receives event - key - space
Attribute - self.jump > 0
Change attribute - Self.Motion.Linear Velocity.Y to 400
Change attribute - Self.Jumps 0

Actor receives event - overlaps or collides with - actor of type - solid
change attribute - self jumps - 1

Thanks

Comments

  • PhoticsPhotics Member Posts: 4,172
    Is there a way to get my actor to jump again after a mid air collision with a non-moving actor?
    I added wall jumping to Arch Fiery... http://photics.com/arch-fiery/ ...which seems similar to what you're trying to achieve. I found that I could have greater control over jumping (more consistency too) if I constrained three invisible actors around the main actor... to the left, right and bottom of the actor. So if the right sensor actor was overlapping a wall, then a wall-jump is possible.
  • TommyTankTommyTank Member Posts: 7
    That's helpful for wall jumping but the actual problem I am encountering is:

    Once my actor hits the wall mid-jump and falls down to the floor, even after moving backwards and forwards along the floor platform, when I press the space bar (the jump button) nothing happens.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    It's probably just a typo but in your post you mention self.jump AND self.jumps, are you mixing your attributes up in your behaviors?
  • PhoticsPhotics Member Posts: 4,172
    edited May 2013
    It's probably just a typo but in your post you mention self.jump AND self.jumps, are you mixing your attributes up in your behaviors?
    I'm thinking it might be a typo too...
    ...or maybe the logic could be changed.

    Why greater than 0?
    Shouldn't it be less than 2?

    I'd probably use a floor sensor.

    If floor sensor overlaps or collides with actor tagged (Floor)
    Set Jump to 0

    If space is pressed and Jump is < 2
    change Jump to jump+1
    change linear velocity to +400

    I'm kinda sleepy, so my logic might not be right, but I'm thinking that's the approach I'd try for wall jumping.
  • TommyTankTommyTank Member Posts: 7
    yeah the 'self.jump' was a typo. sorry guys.

    I'll have a play around with what you suggested later and report back.

    Thanks for taking the time to answer my question.
  • TommyTankTommyTank Member Posts: 7
    I'm still hitting a few problems. I'm gonna keep playing around with my logic and see if I can resolve it (I've only been using GS for 2 days so I think I just need to spend a bit more time experimenting.) Your comments were helpful though.
  • TommyTankTommyTank Member Posts: 7
    What I've ended up doing through a bit of trial and error which seems to work for now is to create a timer - every 0 seconds and uncheck run to completion and put all of my jump behaviours inside there. I think that is resetting all of the attributes that were stopping the actor from being able to jump again.
Sign In or Register to comment.