How to make an object bounce vertically only?

I have a ball that is bouncing on top of some squares. Sometimes it will hit the corners and the ball will bounce off to the right. Is there anyway to make an object bounce vertically only, even when it hit a corner?

You probably could detect a collisions with the thing you’re bouncing off of and test to see if your x velocity exceeds a certain threshold (you probably want some x velocity( and if so adjust the x velocity to something more manageable.

Rob

You probably could detect a collisions with the thing you’re bouncing off of and test to see if your x velocity exceeds a certain threshold (you probably want some x velocity( and if so adjust the x velocity to something more manageable.

Rob