Stop bouncing on a block

How do you use Bounce Height or velocity to make it stop when a player is on a block, how do I make the player just be able to climb on a block
?

7 Likes

@Leaders new topic please


You’d need to add some way to figure out when the player is touching the block. The easiest would be, inside of the player object, a when self bumps block.

Inside of this when self bumps block, somehow either stop the player from moving and probably reverse the latest movement.

Try figuring that out on your own, but if you have trouble let me know and I’ll help some more.
Keep in mind that the velocity is usually used as the amount an object moves in a single frame.

9 Likes

hey! would you like me to turn your post, and it’s replies, into a new topic to discuss creating your idea?

6 Likes

That is what petrichor was talking about. He was making a tutorial on how to do it.

8 Likes

Yep, just asking them if they were okay with it before making it:)

5 Likes

Yeah, that would be great! It would help me and others out

3 Likes

Oh, thanks for the hint on velocity and I will try to see if I get it on my own.

3 Likes

I just got it he coding @Petrichor, I just did on how to stop bouncing on a block. Now all I need to do is do the x Value position. Aye!!

4 Likes

Great job! Let me know if you need any more help.

5 Likes

Oh yeah, I gotta tell you something with it as well. When I use sideways buttons, and then when I move my x position with my character… the block that I am standing on now doesn’t count so now I can walk on air when I do, so how can I fix it? Can I use a width block? If it is how do you use a width block?

4 Likes

How do you stop the character from falling when there is a block there?

5 Likes

Basically for when I bump a block, I have a var names bump?, and it only works for my Jump button. So here is what it says right now:
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
When Self Bumps Square
Set X position to (Self X Position), Y ((Self Y Position) + 6)
Set var (Bumps?) to 1
Set Bounce Height to 0
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
| Check Once if 7 = 7 |
|Increase Bounce Height to 0
|β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”-
But that is all on my When Bumps happens, for my character when I see the when game is playing I have a thing that always repeats when it falls, but for the Bumps? variable I have
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
When game is playing:
Skip skip skip… (Now to the problem of the Bumps? problem)
| Check Once If (Bumps? = 0)
Increase Bounce Height by 0.9
β€”β€”β€”β€”β€”β€”β€”β€”
|Check Once If (Bumps? = 1)
Increase Bounce Height by 0
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”


So basically right now when I try to jump and land on the block, it is pretty good and I can’t fall, but once I move my x position blocks that move me sideways, I start to stand on air instead of falling. That is the part I am confused on.

4 Likes

So what I am trying to do is right now try to figure out if I need a width block, if I do, I don’t really understand it so I will need some advice if it is the width block I need. But of course I don’t want the answer since if I work on my mind I can learn more, I just need some good tips/advice on how to use the width button if it is on what I need.

4 Likes

It seems like the problem is that the bumps? variable does not get set back to 0 after the bump ends. Without a bump ends event, you have to find a way to make it figure out if it is touching the block or not.

Try figuring that out, but if you can’t let me know and I’ll give some more help.

6 Likes

I have been trying to get it on my own on the When :arrow_left: Is pressed, or When :arrow_right: Is pressed, but I haven’t found any solutions on how I can get the Character to fall after :arrow_left: is pressed or when :arrow_right: is pressed when not bumping the Square object. Can you give some hints?

4 Likes

How about using touching instead of bumping?

6 Likes

Try using a variable to detect when an object is touching. If you have two rules, one of them setting it to one value, a second one after the first setting it to a new one, any rules after those two rules will only see the second value. Make sense? Try using that to make a variable which determines if it is touching the block.

5 Likes

I got it down, but when I move my sideways buttons, it will always fall but when standing on a block I will still be on the block but also if I press it on the block it still falls then goes back up really fast, when i’m not standing on a block the character falls (which is what I was hoping to do and wanted to do) but in this occasion when I jump and move the sideways buttons the Bounce Height is too high making my character fall to the void faster than normal which I need to stop since if the character or person tries to make their person jump and move it would move too fast and make them fall. Can you find give another tip to make it less lighter? I’ve been also trying to find that out for a while now.

4 Likes

Try changing how much you change the bounce height variable.

3 Likes