Bouncing Objects Sliding On Walls
I'm trying to make these objects that bounce around the room. I have walls that aren't moveable, the gravity set to 0, and I have the objects set at a restitution of 1. There is a problem, though. The objects like to sometimes slide along the sides of the walls if it hits them at a certain angle, instead of bouncing off of them. How do you fix this?
Comments
http://iliveinavillage.tk/up/134c38698f029c828dbc410bb2b7b893.png
As you see, many of the bouncing objects are sliding along the left and right walls. How are you supposed to fix this?
__________________________________________________________________________
ChocoRun Platformer Template
__________________________________________________________________________
ChocoRun Platformer Template
That said--why not make current velocity = current velocity + (however much it slows down) each time it hits the wall? Then it won't slow down.
EDIT: Or, a completely different route would be--if two types of walls:
1. walls (on right and left)
2. floor (on bottom and top)
When a ball hits a wall, set x velocity to x velocity * -1.
When a ball hits a flor, set y velocity to y velocity * -1
ChocoRun Platformer Template