- Home /
[Java Script] Why is my script not working?
Well, I am trying to make a small zombie shooter game, however my shoot script doesn't seem to work..
var randomnumber = Math.floor(Math.random() *11);
Errors:
Assets/ASA/ASA - Scripts/ASA - Scripts - Player/Pistol.js(6,20): BCE0005: Unknown identifier: 'Math'.
Assets/ASA/ASA - Scripts/ASA - Scripts - Player/Pistol.js(6,31): BCE0005: Unknown identifier: 'Math'.
Answer by DaveA · Aug 15, 2013 at 12:12 AM
Don't make everything static. Find out what static means
Unless you like slow bullets, don't instantiate a bullet and send it off fast. Even if your script works, you'll be asking why the bullets fly through the target without affecting it. Better to use a raycast. Bullets are generally too fast to bother trying to render. Unless, like I said, you have slow bullets (ala Matrix/slow-time or rockets)
I fixed the bottom errors, but I need help on why ($$anonymous$$ath.) isn't working..
I don't see you using '$$anonymous$$ath' anywhere, but in case you meant to use the $$anonymous$$ath library, it's actually '$$anonymous$$athf'