|
Hello, this is the turret script of the tornado twins tutorial. But it works fine ! but how to I get more time between the shooting, so it takes longer for him to reload. now it is about 2 seconds.. how do i make that 5 seconds ? thanks //CODE var LookAtTarget:Transform; var damp = 6.0; var bullitPrefab:Transform; var savedTime; function Update () { if(LookAtTarget) { var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position);
} } } function Shoot(seconds) { if(seconds!=savedTime) {
}
(comments are locked)
|
All you want to do is save the time when you shoot, then keep checking if the time NOW is 5 seconds (or whatever your delay is) more than when you saved the time. Also, get in the habit of explicitly declaring variable types... it'll save headaches and game-cycles later... (Oh, and variable names normally start with a lowercase letter... that's sloppy coding on their part...) hello. it's not working. this is what's happening: first it waits.. and than it sprays so much rockets that it destroys itself. what's wrong ?
Dec 26 '10 at 06:58 PM
Bram 1
Ok now it's working i removed the part " :gameobject " at bullit = Instantiate.. it's now working :D Thank you ! :D
Dec 26 '10 at 07:00 PM
Bram 1
No problem. Please be sure to click the check mark next to the answer, so everyone knows that it has been solved.
Dec 26 '10 at 11:34 PM
The_r0nin
(comments are locked)
|
|
I tried using the same script for my turret and all that comes up in the console is NullReferenceExeption (it looks at me but it doesn't shoot
(comments are locked)
|
