Bouncing Objects Sliding On Walls

11clock11clock Member Posts: 450
edited November -1 in Working with GS (Mac)
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

  • 11clock11clock Member Posts: 450
    Here is a picture of what's going on.

    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?
  • jb15jb15 Member Posts: 602
    Have you messed with the friction attributes? Plus, are the collisions circles, and not squares?
    __________________________________________________________________________

    ChocoRun Platformer Template
  • 11clock11clock Member Posts: 450
    I've changed the friction of the bouncing objects and walls to 0. The bouncing objects are circles. The walls are rectangles.
  • jb15jb15 Member Posts: 602
    Try 0.1 or some low number (I'm just guessing--but I had some trouble with this, and might be able to help)
    __________________________________________________________________________

    ChocoRun Platformer Template
  • 11clock11clock Member Posts: 450
    jb15 said:
    Try 0.1 or some low number (I'm just guessing--but I had some trouble with this, and might be able to help)
    __________________________________________________________________________

    ChocoRun Platformer Template

    Any friction higher than 0 will result in the balls slowing down every time they bounce. It doesn't fix the problem, too.
  • jb15jb15 Member Posts: 602
    OK--I may be heading in the wrong direction here--but since nobody else is posting I'll keep trying to help, until someone pro comes along and tell you in one step what needs to be done. :)

    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.
  • 11clock11clock Member Posts: 450
    jb15 said:
    OK--I may be heading in the wrong direction here--but since nobody else is posting I'll keep trying to help, until someone pro comes along and tell you in one step what needs to be done. :)

    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.

    Because it still won't fix the sliding along the walls problem. I've tried increasing friction and the balls still slide along the walls.
  • jb15jb15 Member Posts: 602
    Friction on both? You want both to be > 0.

    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
  • 11clock11clock Member Posts: 450
    jb15 said:
    Friction on both? You want both to be > 0.

    Nope, the balls still slide along the walls. If this keeps up I'm going to report it as a bug.
  • jb15jb15 Member Posts: 602
    Did you see my edit?
    jb15 said:
    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
  • 11clock11clock Member Posts: 450
    Just did your alternate solution. The balls are no longer sliding along the walls! Thanks!
  • jb15jb15 Member Posts: 602
    Glad to help!
Sign In or Register to comment.