So my gun system is one of those old RRP2 FE ones. I want to make a burst gun, so I duplicated the line of code that creates a bullet. It creates 3 bullets, but I don’t know how to make the bullet parts spread out. They just stay in a bunched up state and only 1 of them hit a target and damage. I’m also really bad at scripting, so I can’t figure this out.
Code:
if hitObject then
bullet = CreateBullet(bulletPos)
bullet = CreateBullet(bulletPos)
bullet = CreateBullet(bulletPos)
edit: I also saw this line that said cFrame, I’m not sure if that’s related to the bullet spread or not so I
l’ll just add it
You’ll need to provide a new angles cframe to the bullet Pos position which should look something like this: bulletPos = <BULLET_POS_HERE> * CFrame.Angles(math.radians(math.random(0,3)), math.radians(math.random(0,3)), math.radians(math.random(0,3))) . You’ll have to do this for each separate bullet, as otherwise they’ll all fire in the same random direction.
Just change the bullet.CFrame line to this: bullet.CFrame = CFrame.new(bulletPos) * CFrame.Angles(math.radians(math.random(0,3)), math.radians(math.random(0,3)), math.radians(math.random(0,3)))
Even then, it’s best to just use a module like FastCast. No need to create individual bullets when a module that has realistic bullet physics can already do the same. There are already example models, so knock yourself out if you plan to use FastCast. It’s easy to use, and you can easily implement spread with it.
I’m fine with the gun system I’ve got right now, it’s just that making it shoot more than 1 bullet is a huge pain. I just want to fix the problem of the bullets not spreading, not my whole gun system