Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How to shoot once a second?

$
0
0
I need the projectile to be instantiated once every second. Instead the projectiles instantiate like crazy. function Update(){ if (Vector3.Distance(transform.position, p1.transform.position) < 10) { InvokeRepeating("Shoot",0, 1); } function Shoot() { Instantiate(projectile, shooter.position,shooter.rotation); } }

Viewing all articles
Browse latest Browse all 171066

Latest Images

Trending Articles



Latest Images

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