Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

I have been working on an fps for 15 hours now and have ran into this error please can you help Assets/Scrips/Gun script.js(7,1): BCE0044: unexpected char: 0xFEFF.

$
0
0
public var bulletPrefab : Transform; public var bulletSpeed : float = 6000; var ammo : int = 30; var gunShot : AudioClip;Shot; var reload : AudioClip;Reload; var emptyClip : boolean = false;} function Update )) { if(Input.GetButtonDown("Fire1")) { if(ammo > 0) { Shoot(); } else{ return; } } if(Input.GetKeyDown(KeyCode.R)) { if(emptyClip) { Reload(); } } if(ammo >= 0) { emptyClip = true; } else { emptyClip = false; } } function Shoot(){ var bullet = Instantiate(bulletPrefab, transform.Find("BulletSpawn").position, transform.Find("BulletSpawn").rotation); bullet.rigidbody.AddForce(transform.forward * bulletSpeed); audio.PlayOneShot(Shot); ammo--; }  function Reload() { audio.PlayOneShot(Reload); ammo = 30; }  function OnGUI() { GUI.Label(Rect ( 0,0, 75, 25), "Ammo " + ammo); }

Viewing all articles
Browse latest Browse all 592


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>