constant movement of a rigidbody with no gravity

I want to get a rigidbody then apply a force to it that keeps at a constanst velocity ignoring gravity.

I have unchecked gravity on the rigidbody and placed it inside a box. Now I want to keep it going at a constant velocity so it bounces off the walls forever.

Any idea how? I thought maybe rigidbody.AddRelativeForce(transform.forward * 1.0, ForceMode.VelocityChange); but it doesn’t seem to work.

Add more force.

–Eric

Actually maybe this isn’t what I am trying to do.

Basically I want to try and make one of those classic brick and paddle games. Except I want the paddle to be spherical. I am trying to figure how to make the ball work.

Easy, Sounds like what you need is to turn both drag and angular drag to 0.

Find it under rigidbody in the inspector(where you turned “use gravity” off).

Then how do i start the ball moving? I tried just putting an addforce in the

AddRelativeForce is fine. As I said, just use more force; 1.0 isn’t much.

–Eric

you can just set the velocity on the rigidbody to get it moving

Thank you for the replies.

I figured how to do it using addforce. The reason it wasn’t working was because I was trying to add the force in Awake (just once to get it started). When I moved it to FixedUpdate it worked fine. I also added the bounce material to the floor.