Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

How do you add force to a clone after you spawn it?

$
0
0
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?

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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