jumping off walls
CLAY
Member Posts: 72
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. --> \
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
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
What kind of rules should I make for the walls (or let's called it platform ) ?
http://img181.yfrog.com/i/image2u.png/
http://img215.imageshack.us/img215/2288/image3d.png
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
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 ...
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 ...
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