Quantcast
Channel: Latest Questions by thecoolracer
Viewing all articles
Browse latest Browse all 33

Unity compiler throwing fake errors? Something wrong with this script.

$
0
0
See for yourselves, tell me if you see something wrong here. This is driving me crazy for two days! var bulletPrefab : Rigidbody; var initialForce : float = 200.0; var Spawnpoint : Transform; var Gunsmoke : Transform; var Firerate : float = 1.0; var NextShot : float = Firerate; var CanFire : boolean = true; function Update() { if (Input.GetButtonDown ("Fire1")) { if (CanFire == true) { Fire (); CanFire = false; NextShot = 0; } } if (NextShot <== Firerate) { Firerate + NextShot * Time.deltaTime; } if (NextShot >== Firerate { CanFire = true; } } function Fire() { if (Input.GetButtonDown ("Fire1")) { var bulletClone : Rigidbody; bulletClone = Instantiate( bulletPrefab, Spawnpoint.position, Spawnpoint.rotation ); Instantiate(Gunsmoke, Spawnpoint.position, Spawnpoint.rotation); bulletClone.AddForce( bulletClone.transform.forward * initialForce, ForceMode.Force ); } }

Viewing all articles
Browse latest Browse all 33

Latest Images

Trending Articles



Latest Images

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