How Can I Have An Enemy Spawn One Bullet?

Discussion in 'How Can I...?' started by Squiggz, Jul 31, 2018.

  1. Squiggz

    Squiggz Boxer

    Joined:
    Mar 5, 2018
    Messages:
    84
    Likes Received:
    7
    I have my enemy run on to the screen with a run and throw animation. I want it to be able to just throw one spear(bullet) at the end of its path. I figured I could try 2 things:
    1. Edit the default animation of the enemy and add the spear and add a spawner but I dont know how to get it to only spawn one.
    2. Maybe use a wake up , but is it possible to use that with an enemy then make the bullet appear with a velocity?

    Im so lost. Attached a picture of the situation. Any ideas? Screen Shot 2018-07-31 at 11.38.20 PM.png
     
  2. surajsahu

    surajsahu Boxer

    Joined:
    Oct 19, 2018
    Messages:
    8
    Likes Received:
    0
    i am in a similar situation here, please could you share the solution if youve found it already?
     
  3. Josh (Nology Games)

    Josh (Nology Games) Head Moderator Staff Member

    Joined:
    Nov 27, 2017
    Messages:
    571
    Likes Received:
    190
    you could have the sleep distance closer then the wake up distance. let me know how you go with that
     
    surajsahu likes this.
  4. surajsahu

    surajsahu Boxer

    Joined:
    Oct 19, 2018
    Messages:
    8
    Likes Received:
    0
    thanks for replying man, but i dont think thats gonna help me, see in my case i have an enemy object spawn a certain number of "coins" and only after collecting said coins i can continue to the next area, but i cant figure out how to have only a certain number of coins to be spawned, can ya please help me with that
     
  5. The Pumpkin Studios

    The Pumpkin Studios Moderator

    Joined:
    Sep 25, 2018
    Messages:
    25
    Likes Received:
    10
    1. For one spawn, you can try is change the time duration / fire rate to 99999. i do not remember the exact name of the setting, apologies for that. you can look through the settings till you find one that controls spawn rate, and change it to an extremely high number, so after firing 1, it will wait 9999 seconds, the level is way over until then.

    2. yes, what you can do, is make an action. when the player hits an action, in the hit animation you can add a spawner for a bullet, make its spawn rate, again, really hig (or low) so it only spawns once every 9999 seconds.

    Both methods are accurate.

    Now especially for your case, you can try what i did, and it worked. I wanted to spawn 4 coins at once in one of our game when the player gets near. so i put a 4 spawners, with high number of time of intervals like 9999 in hit animation of an action.
    Result: player got near, 4 coins spawned, and the game had to wait 9999 seconds to spawn next, at that time player was long gone.

    Hope that helped
     
    Sudeep Patil and surajsahu like this.

Share This Page