i need help with balls bouncing correctly off of walls

diegocsdiegocs Member Posts: 531
edited November -1 in Working with GS (Mac)
i have this circle ("ball") that moves throughout the screen bouncing against the walls, but i can't managed to make it bounce correctlly ("naturally") off the walls (hence i don't use restitution since i don't want a speed change). i tried change velocity to (same velocity) and direction 180-vectortoangle(linear.velocity.x,linear.velocity.y) but that only worked for horizontal walls, and the same thing but with 180 + vectortoangle("", "") it worked only for vertical. Is there a way to mange it to work for both?

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Do you have the collision shape set to "circular" on the ball?
  • diegocsdiegocs Member Posts: 531
    ok i'll take a look at it
    uptimistik said:
    Look for this template in the Creator: Infinite bouncing balls with constant speed

    Best bouncing template I have seen.

  • diegocsdiegocs Member Posts: 531
    worked perfectly uptimistik, thanks
Sign In or Register to comment.