Speed Cap for Rolling Ball

Currently, for a rolling ball I have a simple AddForce script. However, it constantly gains speed to the point where I’m afraid it’s gonna go right through a wall because the physics engine can’t keep up. How would I go about setting a “speed cap” on the ball? UnityScript, please.

You actually don’t need any scripting…use “continuous dynamic” for the ball’s rigidbody collision detection, and “continuous” for any objects that the ball will collide with, then the ball won’t go through anything no matter how fast it goes. If you want a speed cap anyway, you can use drag. Also the max angular velocity in the physics settings will prevent an object from rotating any faster than the specified limit, which effectively caps the speed (for rolling objects anyway).