I want to make a gun, so far it spawns bullets but those bullets travel forward.
this is my code
`void FixedUpdate() {
bulletSpawnPoint = GameObject.Find("BulletSpawnPoint").transform.position;
if (Input.GetKey (KeyCode.Z)) {
Instantiate (bullet);
bullet.transform.position = bulletSpawnPoint;
bullet.GetComponent ().AddForce (0, 300, 0);
}`
What should I do?
↧