i’ve created a few cubes to test my shot force…i mean when i wanted when i shot at some object that object move forward by force here’s the scripts
var range = 500;
var shotForce = 100;
function Update()
{
var bullet : RaycastHit;
if(Physics.Raycast(transform.position, transform.forward, bullet, range))
{
if(bullet.transform.tag == "Map")
{
gameObject.FindWithTag("Map").rigidbody.AddForceAtPosition(transform.forward * shotForce, bullet.point);
}
}
Destroy(gameObject);
}
So when i shot object “cube1” with tag “Map” it will move forward by force but when i shot object “cube2” also with tag “Map” , the object “cube1” moves instead of object “cube2”.