How hard is it to make an fps FrameWork?

So I’ve been looking at fps frameworks like FE gun kit and read the code which is alot and looks very complicated but then I see tutorials such as

It seems to be alot easier
So I’d like to know how hard it would be to make one and if anyone could point me to some key things I might want to learn more about to make one.

1 Like

Depends on how realistic you want it to be as a simple raycast gun with no bullet drop or penetration is very easy to do. As soon as you start adding in realistic ballistics things can get complicated, but it’s mainly about copying different mathematical equations from google and applying it to your system.

(you can always just use a module that does it for you like fastCast)

What sorts of math do I need cause I’ve seen lots of equations involving velocity in the modules I’ve read
Also this is what I’m trying to replicate (it’s a streamable link btw)

External Media

You are able to calculate the position of a projectile in motion (bullets with realistic bullet drop) with this handy equation:

Position + (Velocity * Time) + 0.5 * Acceleration * Time * Time

To put in ROBLOX development terms:

OriginalCFrame + ((OriginalCFrame.LookVector.Unit * ProjectileSpeed) * Time) + 0.5 * Vector3.new(0, -workspace.Gravity, 0) * Time * Time

Bind this to a RunService event such as .RenderStepped and use the deltaTime for the time value. ProjectileSpeed is just the number of studs that would be travelled per second.

2 Likes

so this equation just basically calculates how fast my bullet moves?

It gives you the position the projectile will be in, given its original position, speed, gravity, and time since it was launched

Oh, So I basically just constantly update the bullets position using runservice?

The reason FE gun kit seems so complicated is because, well, it is, and not in a good way. It is a good idea to split your code into modules for reusability and organization, especially when you have a lot of planned features in mind. Theres no definite way to guess how difficult making your fps framework may be, it really boils down to how you organize your code and avoid spaghetti code that could potentially make the system hard to look at and hard to work off of in the future (FE gun kit)

I have a post that has a link to a video of the gun system I’m trying to replicate

Yes. For example:

runService.RenderStepped:Connect(function(delta)
	for index, bullet in workspace.Bullets:GetChildren() do
		bullet.TimeElapsed.Value += delta
		bullet.CFrame = (bullet.Origin.Value + ((bullet.Origin.Value.LookVector.Unit * bullet.Speed.Value) * bullet.TimeElapsed.Value) + 0.5 * Vector3.new(0, -workspace.Gravity, 0) * bullet.TimeElapsed.Value * bullet.TimeElapsed.Value)
	end
end)
			

Personally, I do it with a table that stores a dictionary of information about every bullet, but the above example would work fine as well.

1 Like