how to set rigidbody velocity in unity
//Set Velocity to a certain speed
[SerializeField] private float maxSpeed = 10;
[SerializeField] private Rigidbody rb;
void FixedUpdate() {
if(rb.velocity.magnitude > maxSpeed) {
rb.velocity = rb.velocity.normalized * maxSpeed;
}
}