Welcome!

Welcome to our community forums, full of great people, ideas and excitement. Please register if you would like to take part.

This is extra text with a test link..

Register Now

Announcement

Collapse
No announcement yet.

Bullets not instantiating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bullets not instantiating

    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?

  • #2
    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....
    }
    With the time left, you might get really serious about working with the tutors too.

    Comment

    Working...
    X