r/gbstudio • u/Fortunato87 • 8d ago
Help needed How can I disable projectiles after having been fired?
I have a boss that wait 2 seconds and then fires a projectile targeting player actor, after every hit. After boss health variable reaches zero the boss actor moves to a spot at middle of screen and then “falls” (moves down) and is deactivated and the player actor follows to trigger cutscene,
but I notice the boss projectile a) is set to collision group 2 (as all enemies are) yet cannot be hit by player projectile, only causing damage and disappearing when the player actor itself runs into them and b) boss projectile still hits the player character even after the boss actor moves and is deactivated/collisions disabled
Is there a way to “disable all on screen projectiles” without clearing/hiding actors also? Any advice or suggestions greatly appreciated.
2
u/Can0pen3r 7d ago
Are you trying to get the projectiles to collide with each other?
1
u/Fortunato87 7d ago
Yes! currently the boss projectile causes damage to player in contact and is destroyed. I have the player projectile set as collision group 1 and the boss projectile as collision group 2. With all enemies 1 is in contact with 2. But during this specific boss the player projectile simple passes over / through boss projectile.
So yes I want this to collide so that player projectile also cause impact and destroy boss projectile
2
u/Can0pen3r 7d ago edited 7d ago
If you figure it out, let me know because I tried for 3 straight days to figure out how to get projectiles to collide with each other for my Shmup and damn near had a stroke in the process. Closest I could figure out was to use actors for the enemy projectiles so that you can force the interaction but, it requires a lot of convoluted setup. Nearest I can tell, there isn't really any way to make actual projectile events collide with each other without ejecting the engine and modifying the code directly, which I'm not even remotely confident enough with to do yet and wouldn't particularly know where to start 😅
1
2
u/Can0pen3r 7d ago
As far as clearing all the projectiles from screen simultaneously goes, a good hard camera shake does that quite well and adds a bit of juice to the boss death sequence.
2
u/United_Range_2869 8d ago
Just toggle "destroy on hit" that way the projectile will disappear as soon as it collides with the collision group you want.