I’m working on a FPS framework and I’ve had trouble with how to make a fixed bullet spread. obviously you could easily make random bullet spread by adding a weight of like 5 degrees on a shot, but I can’t figure out how to make a fixed bullet spread without hardcoding it.
All I want to know is what the equation would be.
fixed as in it isn’t random. It stays the same with every shot in a predictable pattern.
TL;DR (I know it’s not long but it’s confusing)
how to not hardcode fixed shotgun spread.
You could create a spread pattern the first time the shotgun is shot, then cache it so that when it is shot again it can retrieve the first spread pattern
Here is a video created by @sleitnick about generating planets equally in a circular play area, if you skip to 14:25 then there will be an explanation of how something like this may be done and the principle word work with shotgun spread.
Here are a few articles that will no doubt help you with this. ^ And perhaps you could use something like math.random(lowerSpread, upperSpread) with a small interval in order to add some variation to it.
So basically like arsenal. Then using a table filled with Vector3s and calling CFrame:ToWorldSpace(CFrame.Angles(vector)). You might need to fill the vectors with radian measures instead of degrees, because CFrame.Angles() takes radians.