Limiting rigidbody Speed.

Hi, me and another person have been making a breakout clone. We used unity rigidbody real physics to do the ball movement, but the ball always ends up going way to fast over time. We are very new to programming and would like to just finish the game already. Could someone help us by showing us how you would limit the speed of a ridgidbody. Currently when the ball hits the paddle oncollision we have a addforce(x,y,z) also same thing when it hits a wall or brick. but yeah after about 30 seconds its going way to fast to play. We want to limit the speed at a certain speed. Thanks hope someone can help.

using UnityEngine;
using System.Collections;

public class Ball_Movement : MonoBehaviour {
	public float count = 0;
    public static bool FireBall=false;
	public int timeOfBonus = 10;
    public static Ball_Movement instance;
    public static bool playerDead = false;

	
	void Awake()
	{
		instance=this;
		  transform.parent = null;
	}
    	
	// Update is called once per frame
	
    // When space is pressed the ball launches and breaks free from the parent.
    void FixedUpdate() {
		if (Input.GetKey ("space"))
		{	
		  count++;
				AddForce();
                 			
		}
        // bounces from the wall
        if (gameObject.rigidbody.collider.CompareTag("wall"))
        {
            rigidbody.AddForce(-1500, 0, -1500);
        }
		   	              		 
	}
// it is adding score to score not to global Score just change it according to your pref but be carefull xD
    void OnCollisionEnter(Collision block)
    {
        if (block.collider.CompareTag("block10point"))
        {
            ScoreBoard.Score = ScoreBoard.Score + 10f;

        }
        if (block.collider.CompareTag("block20point"))
        {
           ScoreBoard.Score =ScoreBoard.Score + 20f;

        }
        if (block.collider.CompareTag("loosingwall"))
        {
            BallCounter.ballCount = BallCounter.ballCount - 1f;
            Destroy(gameObject);
            if (BallCounter.ballCount <= 0)
            {
                BallCounter.ballCount = 1;
                ScoreBoard.Lives = ScoreBoard.Lives - 1;               
                playerDead = true;
                Destroy(PaddleMove.Instance.gameObject);
                
            }
                                                    
        }
     	
	}


	void AddForce()
	{ 
		if (count < 2) 
       rigidbody.AddForce(1500, 0, 1500);
			else
			return;
  }
public void AddForce2()
	{
		rigidbody.AddForce(100, 0,100);
	}
	
}

How about adding a script which does this:

  public float maxSpeed = 200f;//Replace with your max speed

  void FixedUpdate()
  {
        if(rigidbody.velocity.magnitude > maxSpeed)
        {
               rigidbody.velocity = rigidbody.velocity.normalized * maxSpeed;
        }
  }

a shorter way to do this probably using Vector3.ClampMagnitude @whydoidoit

public float maxSpeed;

rigidbody.velocity = Vector3.ClampMagnitude(rigidbody.velocity, maxSpeed);

@calebgray Thanks for reply (sorry i’ve acidenlty removed my previous comment)
One of solution which i found is (setup proper air resistance (Linear drag), so it would limit the max speed for your rigid body)
Then to fix your gravity, you would need to change gravity scale. Unfortunately i don’t have any formulas, so i’ve seed up this parameter empirically.

After all of this changes, physics movement works very smooth and nice.

You probably can use this:
yourTransfrom.Rotate(yourVector3yourSpeedTime.deltaTime);

How do you limit Rigidbody on one specific direction. So that i can cap the speed individual axes.