howe to make a rocket do damage?

hi i am new to unity and i am making a fps middel age game

since i am a realy bad scripter (i have no idea of it at all)

i am using pre made maps for unity tutorials to make my game

now here is my problem
the unity tutorial only has a science fiction fps
where it uses a machine gun or a rocket launcher

since i am making a bow i used the rocket launcher script
and i added the rocket script to the arrow

but the problem is the arrow does not do any damage
i just want the arrow to hit the robot and make sure the robot just dies

i don’t want a explosion and all these things
i just want to make the arrow so when ever it hits the robot robot dies

does some 1 know howe to do this?


i also have an other problem with maya
i can’t load any files from maya in to unity (see support topic)

thnx forreading and i hope some one knows howe to do it


this the the arrow script:

// The reference to the explosion prefab
var explosion : GameObject;
var timeOut = 3.0;

// Kill the rocket after a while automatically
function Start () {
Invoke(“Kill”, timeOut);
}

function OnCollisionEnter (collision : Collision) {
// Instantiate explosion at the impact point and rotate the explosion
// so that the y-axis faces along the surface normal
var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
Instantiate (explosion, contact.point, rotation);

// And kill our selves
Kill ();
}

function Kill () {
// Stop emitting particles in any children
var emitter : ParticleEmitter= GetComponentInChildren(ParticleEmitter);
if (emitter)
emitter.emit = false;

// Detach children - We do this to detach the trail rendererer which should be set up to auto destruct
transform.DetachChildren();

// Destroy the projectile
Destroy(gameObject);
}

@script RequireComponent (Rigidbody)


and this is the bow script

var projectile : Rigidbody;
var initialSpeed = 20.0;
var reloadTime = 0.1;
var ammoCount = 20;
private var lastShot = -10.0;

function Fire () {
// Did the time exceed the reload time?
if (Time.time > reloadTime + lastShot ammoCount > 0) {
// create a new projectile, use the same position and rotation as the Launcher.
var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation);

// Give it an initial forward velocity. The direction is along the z-axis of the missile launcher’s transform.
instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (0, 0, initialSpeed));

// Ignore collisions between the missile and the character controller
Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);

lastShot = Time.time;
ammoCount–;
}
}

thnx for reading and i hope some 1 knows the answer

I’m not sure what’s the issue you’re having.

The explosion is happening in the “OnCollisionEnter” function.

As you can see there, in that function is where you instantiate the explosion object and kill the “rocket”.

the problem is

when i shoot the arrow does not dis apear (kills his self) on inpact

it just bounces of

Do a Destroy(gameObject) on the arrow’s OnCollisionEnter().

That will make it disappear.

ok thnx but is there a option that i add a script to the player and ai that does this

if gameObject collison with arrow
destroy game object

in this case is the gameobject the player.
and arrow the arrow ^^

if some one know howe to make that can he plz reply
or sned a pm with the scipt in it

thnx for reading hope some one knows the answer