How to make shotgun instant hit spread

Putting this bit of code in a for loop should do the basics of what you are after.



const FVector ShootDir = WeaponRandomStream.VRandCone(AimDir, ConeHalfAngle, ConeHalfAngle);
const FVector EndTrace = StartTrace + ShootDir * InstantConfig.WeaponRange;

const FHitResult Impact = WeaponTrace(StartTrace, EndTrace);
ProcessInstantHit(Impact, StartTrace, ShootDir, RandomSeed, CurrentSpread);


Once you’ve got that working you’ll then fall down the rabbit hole of “why is only one particle effect appearing”, and then the issue of trying to “replicate all the data to the client” (if you are making a multiplayer game).

But this is the starting point :slight_smile: