So, I’m making an FPS game and run into a problem when I shoot the bullet out of the gun at the Muzzle Position as a starting point. But the if I rotate the camera around fast, the bullet trail position seems to be off comparing to the where the muzzle position currently is.
So as an attempt to fix this problem, I’ve tried to predict where the muzzle will be if we rotate the camera by using a loop and some line of code to figure it out:
local LastMuzzleCFrame = CFrame.new()
local PredictedMuzzlePosition = (Muzzle.CFrame:ToObjectSpace(LastMuzzleCFrame)).Position
LastMuzzleCFrame = Muzzle.CFrame
--Send it to a server
But it didn’t work that well because the same problem still occurs.
Yes, and I forgot to mentioned that the PredictedMuzzlePosition is just an add-on to the Muzzle position so the full script is gonna look like this
remoteevent.OnServerEvent:Connect(function(player, MuzzlePos, PredictedPosition) -- the current muzzlepos is already included and the Predicted Pos is just an addon to that
local BulletCurrentPosition = MuzzlePos + PredictedPosition + . . .
Therefore, I notice fps games like Bad Business for example, their bullet position is pretty much precise to the muzzle position, so do you think that they have the similar approach of casting a local bullet in order to hide the delay?