I'm creating a game where the player can shoot things in the map, and the bullets are controlled by a script that I made.
For that to work, I have an event in the map that check if the player is pressing a key (like the C button), check if there is already another projectile fired (by verifying the picture name in the slot) and calls a new instance of the script with the correct picture slot.
The issue is that while one instance of the script is running, the event that called the script (in this case it's the event that checks for input) pauses (even if the event is a parallel process). This means that only one bullet can exist at a time.
A workaround that I found is instead of having the event that checks inputs calling the script, have the event change a switch, which triggers a common event that calls the script. This means that for every projectile, I would need a common event and a switch dedicated for that (something that can bloat the project).
So my question is: How can I make the event NOT wait for the script call to finish running?
(project file attached)
For that to work, I have an event in the map that check if the player is pressing a key (like the C button), check if there is already another projectile fired (by verifying the picture name in the slot) and calls a new instance of the script with the correct picture slot.
The issue is that while one instance of the script is running, the event that called the script (in this case it's the event that checks for input) pauses (even if the event is a parallel process). This means that only one bullet can exist at a time.
A workaround that I found is instead of having the event that checks inputs calling the script, have the event change a switch, which triggers a common event that calls the script. This means that for every projectile, I would need a common event and a switch dedicated for that (something that can bloat the project).
So my question is: How can I make the event NOT wait for the script call to finish running?
(project file attached)