How to disable something based upon collision.
Trampskey
Member Posts: 4
Hello intelligent people of this forum, I am looking for assistance, you see, I am making a platformer game, most of it is working, but I have ran into the problem of my character basically "flying", as he can jump continuously in mid air, I have tried recoding the jumping physics and gravity, I have tried using timers to limit the jumping, but nothing seems to work, so I theorised I could create a system where the action of jumping is disabled unless you have collision with actor "floors" so you could jump off the ground, but once you are in Mid-Air, you can't jump again until you once again have collision with the floor.
I imagined it would go something along the lines of
if - collision with actor "floors" is true
do - change attribute game.up to true
else - change attribute game.up to false
But this isn't exactly right as far as I can see, what would be the best way of going about this, creating an attribute that would account for acceleration, was my first guess, but I am still not sure how to do that, any help would be much appreciated, thank you, and I look forward to your replies.
I imagined it would go something along the lines of
if - collision with actor "floors" is true
do - change attribute game.up to true
else - change attribute game.up to false
But this isn't exactly right as far as I can see, what would be the best way of going about this, creating an attribute that would account for acceleration, was my first guess, but I am still not sure how to do that, any help would be much appreciated, thank you, and I look forward to your replies.
Comments
Then you would need to make your rules in the actor say something like this
when attribute.grounded is true + "whatever makes the character jump" is true
jump
otherwise = nothing