1. What do you want to achieve? Keep it simple and clear!
Well, i want to make a simple smooth camera movement for my car chassis system.
2. What is the issue? Include screenshots / videos if possible!
The camera seems to ‘lag’, notice (video below) that the car itself is the only one that’s lagging, if you take a closer look at the baseplate or horizon you can see that it is not lagging at all.
When disabling the camera script the car is moving smoothly again.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes, I did, I couldn’t find anything related to this topic.
I’ve tried using the weighted linear interpolation instead:
v = ((v * (N - 1)) + w) / N
It has made it a bit smoother but yet still was too rough.
I also tried using Tween Service but it also failed.
No more clues from me.
This is a piece code i’ve been using:
local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.FieldOfView = 50
local CamPart = veh.Body.cam
--//Service
local Service = {}
Service.Tween = game:GetService("TweenService")
Service.Run = game:GetService("RunService")
threshold = 1
Service.Run.RenderStepped:Connect(function()
if Values.Velocity.Value.Magnitude > threshold then
Camera:Interpolate(
CamPart.CFrame,
veh.Body.focus.CFrame,
.1
)
end
end)
Thanks in advance, a detailed explanation would be very appreciated.