Best way to script bullet physics?

Hi! Right now I’m trying to make a FPS gun. I’d like to make quite realistic bullet physics - possibly including bullet drop. I want them to move smooth and generally avoid lag and also make sure the hit detection is reliable. My question is: what would be the best way to achieve that? Should I use TweenService, physics or just some CFrame math?

I don’t think TweenService would be very reliable, it’s probably better to use CFrames and also some physics

You should change the Bullet velocity, and with a while true do loop create a ray according to its front face vector .Unit * 10, 10 because we want it to detect it good, you can just do like this

Bullet.Anchored = false
Bullet.CanCollide = false
Bullet.CFrame = Tool.FirePart.CFrame
Bullet.Velocity = Tool.FirePart.CFrame.LookVector.Unit * 3000 -- 3000 Could be any speed
while Bullet do
local Rayy = Ray.new(Bullet.CFrame.Position,Bullet.CFrame.LookVector.Unit * 10)
local Hit,Position,Surface = workspace:FindPartOnRayWithIgnoreList(Rayy,{Player.Character})
if Hit then
-- Event detection here
Bullet:Destroy()
end

wait()
end
game:GetService('Debris'):AddItem(Bullet,20)
2 Likes