Inconsistency between the Hitscan module and Projectile module "Fire Count" parameter

Ok, so I have this shotgun that use both the "Hitscan" and "Projectile" module as well as a module switcher and everything worked just fine. but I found out that the Projectile module didn't shoot the same amount of Fire count that his Hitscan counterpart despise having the same parameter. (See video below)

ProjectileFire Count bug :

Tested only on the UFPS v.3.0.14, need to test on the others.

Step to reproduce :
1. Create a new Unity project and download UFPS newer version
2. Install the controller
3. Using the shotgun and the assault rifle from the demo, set the shotgun so that it can fire projectiles and change module too (like the assault rifle)
4. Make sure that the projectile shooting module has the same "Fire Count" parameter as the Hitscan one
5. Once finished, go to the demo scene and press "Play Mode"
6. Using a Boxing Joe from the demo, shoot it while changing between hitscan and projectile shooting module
7. Look at the amount of damage done to the boxing and you will see the inconsistency despite sharing the same parameters.
 
This looks like a bug.
I'm looking at the code right now.
I have a suspition of what the issue could be but it could take awhile to fix.
I'll have a deeper look first thing next week.
 
So trying to replicate the issue I found that it starts working correctly after reloading the weapon.

That gave me something to go on.
After more testing I saw that all projectiles were being fired but got destroyed a few frames later leaving only one bullet.
Turns out the layer wasn't set fast enough on spawn because of a delay set to 0.1 and that caused the bullets to hit each other

So removing this delay and adding some spread it works, no code change needed.
My assumption is that it startes working after reloading because the bullets are prespawned with the correct layer

1691400395343.png

For reference this is my setup
1691400350433.png

I'll just change the default delay to 0 so this doesn't happen to someone else:
1691400579014.png
 
Top