- Home /
Collider question
Hello, i'm making a collision-damage system This is my script:
function OnCollisionEnter(collision : Collision)
{
health = health - damageConstants*collision.impactForceSum.magnitude;
if (health <= 0){
DestroyObject();
}
}
---And there is my bullet script:
var BulletSpeed = 7000;
var Smoke : GameObject;
function Start ()
{
rigidbody.AddForce(transform.forward * BulletSpeed);
}
function OnCollisionEnter (collision : Collision)
{
Instantiate(Smoke , transform.position, transform.rotation);
Destroy (gameObject);
}
But i found there is no difference between (7000 force - 1 mass in rigidbody) vs (700000 force - 100 mass in rigidbody) damage cause, it's the same damage, could someone help me out, I want to make more types of bullet. Thanks all.
Comment