jumping off walls

CLAYCLAY Member Posts: 72
edited November -1 in Working with GS (Mac)
My problem is that my actor can jump off walls when he has speed in a horizontal direction.
He can climb tall walls this way and i don't want that.
He can even climb diagonal walls that have the slope facing him, its unrealistic. --> \

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    it's because you're using the same actor for the floor as the walls. try creating a new 'wall' actor and give it different rules
  • CLAYCLAY Member Posts: 72
    I know that... that's the first thing that I did but it's the same. By the way what do you mean by "give it diffrent rules" ?
    What kind of rules should I make for the walls (or let's called it platform ) ?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    instead of setting an that 'OnTheGround' to true, just have a rule that says when it overlaps or collides with the ground. that's what I did.
  • CLAYCLAY Member Posts: 72
    I don't understand which rule are you talking about and which ground ?!?!

    My problem here is to make a platform that my actor can't climb verticaly at it but I want him to still jump when he is on the "platform".

    I looked in the forum and I see that I'm not the only one who have this problem ... I did my search before I post and I did'nt find anything ...
  • CLAYCLAY Member Posts: 72
    when i put the rule on the ground "true" for both floor and platform he can double jump when he collide the horizontal part of the platform...
    But when i make a rule on the ground true for the floor and 'false' for the platform he can jump only when he is on the floor ...
  • CLAYCLAY Member Posts: 72
    anyone ?
  • butterbeanbutterbean Member Posts: 4,315
    Clay:

    Here's a summary of the rules I use for jumping, it can be done in other ways, so this is just one solution

    Create a boolean attribute for the actor you want to jump: name it "ontheground"

    Put these rules in that actor:
    When ALL are true:

    When attribute: ontheground is true
    When space key is down (or whatever key you want to designate as jump button)

    Change attribute: self.ontheground to false

    Timer: for 0.1 seconds (check run to completion)

    If self.motionlinearvelocty Y is < 250

    Accelerate : Direction 90: Acceleration: 2500

    I also have rules for the actor checking that he's on the ground

    --------------------------------------------------------------------------------
    So create another rule in your same actor:

    Name it RULE: "On the ground"

    When actor overlaps or collides with: Ground actor

    When self.motionlinearvelocity Y < 10
    When self.motionlinearvelocityY > -10

    Change attribute: Self.ontheground to TRUE
    ---------------------------------------------------------------------------
    Also create another rule, separately in the same actor

    Call it RULE: "Still in the Air"

    When ALL is true:

    Self.motionlinearvelocity Y > 10
    Self.motionlinearvelocity Y < -10

    Change attribute: self.ontheground to 0 or false

    Also: on your ground actor, make sure the check box is clicked so it's not moveable, and that it's fixed

    Set your main actor to collide with the ground actor, you can also create "Actor tags" if you have more than one ground actor you would like the player to collide with, and it will respond to those actors

    Hope this helps! again this is one solution, someone might have a better one

    I put lines in between the rules so you can see them separately
Sign In or Register to comment.