I tried to do camera system in car but it’s too twitches.
Here video
Script
task.spawn(function()
while task.wait(0.1) do
if self and self.Seat.issit == true and self.plrdata.hum.SeatPart then
local calcu = self.plrdata.hum.SeatPart.Position-lastposes
self.DataStorage.Main.AddPose.Value = calcu
lastposes = self.plrdata.hum.SeatPart.Position
end
end
end)
I don’t understand why it happening. But the problem is in this script
um, well I mean what is the purpose of lastposes and self.DataStorage.Main.AddPose.Value and also where is the Camera’s CFrame is updated exactly, there might be synchronizing issues or even problems in how the cars physics is calculated (a stretch but possible)
Ok my last piece of advice is to also make sure the calculations are bound to PreRender aswell, as task functions are called after rendering, so to test it try something like this:
heres a little chart i found on roblox’s documentation to show how roblox steps through frames, and its important that all camera manipulations happen before the screen drawing
Of course it is laggy bro, you’re running this code in a literal while loop that only runs every 0.1 seconds. This is also extremely unoptimized and your variables are not named well. Put the camera calculations in a Heartbeat Loop, or just make your camera first person.