So I'm trying to have the enemies shoot out a bullet when a random number is greater than my fire rate float, however nothing is happening, I've tried running a debug log to see if the bullets are instantiating but somehow disappearing and that doesn't seem like the problem. Could I get some help?
Announcement
Collapse
No announcement yet.
Bullets not instantiating
Collapse
X
-
I'd start by making sure that you're getting to the MoveEnemy method (create a little debug log in there to see if that function actually fires).
Then, I'd put a little Debug.Log inside your foreach statement to make sure you're getting into that area. See if that actually works.
If both of those are actually functioning, I'd rework that random function. That might work (as you have it) but I've not seen it before. You might try something like:
Code:float randomValue; randomValue = Random.Range(0, 12); if(randomValue > FireRate) { Instantiate.... }
Comment