I’m making a game with dozens of different firearms (and I’m adding more as I go). Most of them have pretty much all the same attributes with different values (damage, range, spread, etc.) so a data asset would work for most of them.
But some weapons have special characteristics (every third shot does 2x dmg, shots to the leg slow down) that require more than just attribute tweaks. And would modify the weapon BP functions themselves.
What’s the best way to structure my weapon system without getting too disorganized?
You could have a variable that determines what effect the gun has, and check for that in the blueprint when the bullet fires or hits etc. It does mean that all the effects are in the base blueprint, but that might be slightly more organised than having a blueprint for each unique effect.
I don’t think that’s efficent though, the fire function would cycle through an insane amount of checks on every bullet of every gun.
I think it depends on how many effects guns can have. I was thinking there would only be a few effects per gun, and then you can just use a switch to do something different for each effect slot.
I will change my answer to child blueprints.
1 Like
You can Add the weapon bp in the data asset as variable, so instead of spawning the base weapon spawn the variable one with its special code.
1 Like
Yeah, I found a good workflow with child blueprints. Thanks!