Demo: Видео 10-07-2022 01:14:11.mp4
Hi everyone! i using RoPID for smooth camera movement,
The problem is that the camera jerks at speed, as if it is lagging behind and catching up with jerks. How can this be fixed?
local RunService = game:GetService("RunService")
local RoPID = require(script.RoPID)
local Vec3 = require(RoPID.Util.Vec3)
local controller = Vec3.new(0, 2, 0)
local camera = game.Workspace.CurrentCamera
local goal = game.Workspace:WaitForChild("C100").Chassis.CameraPoint
wait(15)
local function rr(dt)
local output = controller:Calculate(goal.Position, camera.CFrame.Position, dt)
camera.CFrame = CFrame.new(output) * CFrame.fromOrientation(math.rad(goal.Orientation.X),math.rad(goal.Orientation.Y),math.rad(goal.Orientation.Z))
camera.CameraType = Enum.CameraType.Scriptable
end
RunService:BindToRenderStep("RunCam", 0, rr)
Here you can see the problem better - Video
When the bus starts to move, the camera starts to lag. I tried to set different render priorities ( 0 - 10 ), it doesn’t help.
I set this priority, did not help
When a person gets on the bus, he becomes the owner of the bus and the network through the script. If you turn off this camera script and set the default camera, then the bus rides smoothly Video, there are no lags. Therefore, the problem is most likely in the installation of the CFrame camera
You only tuned your integral gain so you dont even have a stable pid controller.not sure why the behavior is still tolerable, probably dumb luck tbh. if your whole thing is it isnt smooth I would just interpolate it. You only use PID for stuff that has no equation