Disable Movement when jumping

WolvennaWolvenna Member Posts: 11
edited November -1 in Working with GS (Mac)
So after a bunch of searching and tweaking I've finally gotten my actor jumping the way I want it to. However, once it's in the air I don't want the player to be able to move it left and right. I've searched the forums, and the cookbook, but haven't found a suitable answer. After messing around with different rules and attributes I can't seem to find any that actually work.

Does anyone have any suggestions?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    You could make a rule that when player is jumping;
    Constrain Attribute self.position.X to self.position.X

    Try that.
  • DrGlickertDrGlickert Member Posts: 1,135
    Oh, make sure you put in an OTHERWISE; Constrain attribute self.positionX to game.playerX
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    No need for constraints or anything. Simply have your move rules in another rule that states when actor overlaps or collides with ground. That way once your in the air it disables the movement

    Cheers
  • WolvennaWolvenna Member Posts: 11
    @DrGlickert: I had thought to try something like that (and did) but since no matter where an actor is their X position is always equal to their own X position it doesn't really stop it from moving.

    @JohnPapiomitis: Ack! I knew it was going to be something simple. Thanks John that worked perfectly!
Sign In or Register to comment.