Hi.
First I’m a beginner,
Please I look for a solution for waiting moments between projectectiles instantiated
The gun must wait between cartridges
Thanks
Hi.
First I’m a beginner,
Please I look for a solution for waiting moments between projectectiles instantiated
The gun must wait between cartridges
Thanks
Create an integer counter variable and set it equal to zero. Then in your Update() method (or FixedUpdate() if you want to be consistent across machines and platforms) check to see if the variable is greater than or equal to the desired value for the pause (eg: 30 would approximately be one second, I believe), and if so, instantiate a new projectile based on a prefab and reset the value of the variable to zero. If the variable is not greater than or equal to your desired value, simply increment the variable.
You could also generate a random number for the pause value if you want the time between projectiles being instantiated to vary.
thank you