[FIXED] When firing multiple bullets in the same event with the fire bullet behavior, only one bullet is created

at first I thought it was firing all bullets at the same angle, however after adding objects with different sprites I have concluded that only the first object in the action is created. I tried spacing them out by adding a variable counter that went up by one when the mouse was clicked, then that triggered a different statement to fire a bullet then increase the counter to trigger a new event and etc. etc. but again only the first object is being created. adding a second object and firing both in the same action only creates one bullet as well. is there any way to fire multiple bullets at once with the fire bullet action?

Can you screenshot (Alt + Print Scrn keys) you events? We may be able to spot where you’ve gone astray.

Of course.

this only produces one object, (new object 3) going slightly to the right of the cursor (since NewObject2 uses rotate towards position with the position set as mouseX() and mouseY())

Open the debugger to confirm that the number of NewObject32 instances is 0 when the number of NewObject3 is 1.
Or apply different speeds to the bullets.

changed the firing speed of NewObject3 to 1000, the results of left clicking a few times as well.
NewObject32 is not being created upon left click?

Then it seems something is wrong with your Fire action.
You can open it with double-click to check if something appears in red.

Is this action from an official extension?
Try duplicating the event block and keeping only one Fire per block.

I do not know if it is official, this addon was found in the “search new behaviors” tab.
As you can see, no variables are highlighted red.

This produces the same result of only NewObject3 being created. Switching the bottom action from “left click” to “right click” does allow me to shoot New Object32, however I would like to be able to shoot both at the same time.

Looks like something is wrong with the extension, then.
I’m moving the topic to bug reports.

Thanks for your input.

I looked into the extension. There’s a firerate timer, so when the first bullet is shot, the timer is reset and the second bullet cannot fire when the condition is called again.
I updated the extension to fix this, it should be included in the next version.
If you want to fix it on your side, go to the extension editor, and move the timer resets to a DoStepPostEvents with a ‘has just fired’ condition. :slight_smile:

Yeah, the fire rate property not letting you fire before the timer is up makes perfect sense as a reason for it not making multiple objects at the same time, good catch. Also, thanks for the suggestion for a fix, that works fine for what I need it for.

1 Like