Reload and Fire rate.

i need help with scripting reload an the fire rate.

any help would be Nice :slight_smile:

My current “fire script” is

var projectile : Rigidbody;
var speed = 20;


function Update () {

    if ( Input.GetButton ("Fire1")) {

         clone = Instantiate(projectile, transform.position, transform.rotation);
         clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));

         Destroy (clone.gameObject, 3);
             
 }}

If your problem is solved accept an answer. - Read this page : http://answers.unity3d.com/page/newuser.html - Please watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

Can a high-karma user please accept the answer because the OP seems to have abandoned UA before doing so. Regards, ExTheSea

1 Answer

1

After a quick google search i found this forum thread with a similar script that i use which has all the features you want:

http://forum.unity3d.com/threads/7073-Taking-MachineGun-js-a-bit-further

Next time please search before you post a new question.

sorry for the numbers to the left of the script... dont know why it happend

That should have been a comment not an answer. - Read this page : http://answers.unity3d.com/page/newuser.html - Please watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

Tanks :) i have been looking but in the wrong places i guess :P

If your question is answered please accept an answer.