- Home /
pong question
if i attach a physics to the paddle then i can use verlosity to move the paddle up and down and the colliders will not allow the paddle to move past the top or the bottom. but when the ball hits it slides up the paddle and not bounce off.
if i not put physics on and move the paddle by translate then the paddle moves past the colliders of the top and bottom , but the ball bounces off it correctly
so how do i solve this
Answer by ScroodgeM · Aug 10, 2012 at 09:29 PM
http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html
just create physic material(s), set bouncyness to 1 to all materials, attach them to colliders and you should got it
how did you try that?
set bounce of physic material to 1
apply this material to both colliders
move one collider to another with rigidbody (not kinematic)
you did that all?
Answer by marceloroca · Sep 05, 2012 at 03:33 PM
I have developed a prototype of pong, if you want to review the code you can enter on this pages:
Working demo (webplayer):