Add force to bullet

Hi,i want to add a force to bullet.when i use of rigidbody.addforce,the bullet will going in endless position.in other word,i want the bullet stop after a known meter and fall to floor,how?

The bullet needs to know what position to measure from. For example you could do something like:

var fallDistance = 5.0;
private var gun : Transform;

function Start() {
	gun = GameObject.Find("SpawnPoint").transform;
}
 
function FixedUpdate () {
	if (Vector3.Distance(gun.position, transform.position) > fallDistance) {
		rigidbody.velocity.x = 0.0;
		rigidbody.velocity.z = 0.0;
	}
}

This will cause the bullet to come to an immediate stop at that distance and fall to the ground.

Another solution is to set the drag of the Rigidbody higher. This will cause the bullet to slow and then stop. It will stall fall because gravity is adding force each frame.