Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Why is this inconsistent?

$
0
0
Im trying to make a bullethell game and this is my code for the enemy shooting. public void Shoot(GameObject myPrefab) { GameObject bullet = Instantiate(myPrefab, transform.position, transform.rotation); Rigidbody2D rb = bullet.GetComponent(); rb.AddForce(transform.up * 5, ForceMode2D.Impulse); } } But for some reason the bullets go a seemingly random speeds. Some will crawl across the screen where others will dash across in half a second. Help?

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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