I have a game where u bounce a ball with platform and u have to destroy all boxes but my code for bounceing ball its not working like I want. It works like a real ball bounce but I want the ball to bounce like a ball in pong where ball don’t fall down until it touches wall or platfotm but my ball goes in real life curve. What I thing with curve is like when u kick a ball in the air and goes in curve but I want it to go unlimitly in flat line to the wall andbounce in a random direction. Someone have any code ideas?
Rebaid.com
Hi! If you go to the RigidBody script on your ball, you can try turning the Gravity Scale from 1 to 0, this will effectively turn off gravity. This should give you the behaviour of a pong-like ball.
After that, you’ll probably want to give the ball some starting speed when it spawns, which would look something like this:
RigidBody rb = GetComponent<Rigidbody>();
rb.velocity = new Vector3(1, 2, 0);
Hope this helps!