|
Okay so for some reason my handgun just doesn't shoot. I made an explosive sphere that has hit points. Can't test it out because weapon not working. The handgun code:
(comments are locked)
|
This isn't changed, just better formatting... Where are you spawning/creating/instantiating the prefab/bullet? Sorry, not seeing it... When it does FireOneShot(); when you click, it makes the direction, and a raycast... Aplies a force if it hits something, and spawns some particles, then it takes away damage from that item if possible.. Finally it takes out some bullets, checks if their is no bullets, if so, they reload.... Their isn't any bullet.. Am I right? Also, maybe you don't want a visual bullet, then in that case, you have to make the particle system to use for the ParticleEmmiter up top... Hope that helps! Ye I don't want visible bullets. Just the sparks or whatever to show where bullets have been fired if you know what I mean. Check the image I just uploaded above. The bullets go down and automatically reload when hits 0.
Dec 05 '10 at 09:52 PM
Daniele
I try to continuously shoot the explosive sphere that only has a mere 20 hits points... nothing happens basically ;/
Dec 05 '10 at 09:56 PM
Daniele
What a mess of a script. First tip: add #pragma strict to the top so you can have the inspector tell you problems so we dont have to. One thing it would tell you is that Fire () isn't even called. Firerate variables only do stuff when you have if statements to consider them. In your if(Input.GetButtonDown) it should consider the firerate like: if(Input.GetButtonDown && NextFireTime == 0) Personally... I would start over on this script.
Aug 13 '12 at 11:02 PM
Dev Solo
(comments are locked)
|


Please make sure your code is correctly formatted, because its unreadeble like this.
Could you tell us what isnt working?
How does one put in correct format? Sorry Im new to all this ;/
In correct format now. Basically nothing happens in game when I left click to fire weapon. Though on the far right it says bullets left and that goes down after each click.