I recently tried to make a Pong like game and I noticed that the Ball doesn´t refelct from the Top/bottom Wall if the Y-velocity of the Ball is smaller or equal to 1.It just slides along the Collider setting the Yvelocity to 0. I tried a similiar collision in a new project with less code, where i just let the ball collide with a Boxcollider, but the same Problem occured.
I just recently started conding and I´m not verry experienced with Unity so I would be thankful for every help.
I don´t think that the problem has anything to do with the Code but just in case I attached it here
var Yspeed : float;
var Xspeed : float;
var projectile : Transform;
function Fire () {
GetComponent.<Rigidbody2D>().velocity.y = 0;
GetComponent.<Rigidbody2D>().velocity.x = -Xspeed;
GetComponent.<Rigidbody2D>().velocity.y = Yspeed;
projectile.position.x = 10;
projectile.position.y = (-Yspeed/Xspeed)*10 + 7.86;
yield WaitForSeconds(5);
Start();
}
function Start () {
Fire();
}