|
Heres my script its soposed to shoot but im missing something can some one help me its Javascript what am i missing to make it want to shoot then or can you point me in the right way tornadotwins didnt help they dont use javascript
(comments are locked)
|
|
There is nothing in this code that indicates it will shoot anything. Move, rotate, ignore Jump, that's all.
(comments are locked)
|
|
First of all, bulletPrefab is your bullet prefab, it needs to be declared as GameObject. Then in your character control script, you need to do so when your mouse is clicked. It will instantiate a bullet prefab in correct direction. See below: You also need to create a script to control movement of your bullet. Put below on your bullet prefab: That's basically the idea how to shoot a bullet out. Unless you need to see the bullet move (slow motion), why use them like that at all? Probably easier to cast a ray for 'instant hit'.
Jun 08 '11 at 08:03 PM
DaveA
because he has a bulletPrefab in his script.
Jun 09 '11 at 01:35 AM
Dreamer
(comments are locked)
|

Please edit your question, select the code, and hit the 101/010 button to format it as code. Thanks
Tornado twins do use java script in there tutorials..