Camera Subject Set to Moving Part Creating a Stutter Effect

Background:

For a game that I am developing, players have their camera subject set to their locally created moving plane (which moves in a linear path via tween service). The camera type is “Custom”, meaning that players can look around in a 3rd person type of view from the plane…

Problem:

For some reason, the plane is moving super smooth, but as soon as I set the camera subject to the plane, the plane looks like it is stuttering a bit in mid air.

Notes:
  • I know that the network ownership for the plane is set to the local player because the plane was created from the local script
  • The actual plane movement is super smooth because it’s using a tween created from tween service

Any thoughts?

Maybe updating the camera focus?

I think what might be happening is that the part physics (and therefore position) is updating asynchronously to camera updates.
As you may know, camera updates are bound to run service’s render step at Enum.RenderPriority.Camera. You could try updating the plane’s position right before the camera updates:

local Plane = -- plane model

local planePosition = Instance.new("Vector3Value")
planePosition.Value = Plane.Position
local planeTween = TweenService:Create(
    planePosition,
    TweenInfo.new(),
    {Value = Plane.Position + 100}
) --something like that

--when the position should be tweened
planeTween:Play()

RunService:BindToRenderStep("planeMovement", Enum.RenderPriority.Camera.Value - 1, function()
    Plane.Position = planePosition.Value
end)

planeTween.Completed:Connect(function()
    RunService:UnbindFromRenderStep("planeMovement")
    Plane.Position = planePosition.Value
end)
2 Likes

What are you setting the CameraSubject to the Plane Model or a Part inside the plane model?

The plane is a meshpart (I modeled and textured it in Blender)

The movement is now smooth :slight_smile:

Thanks @goldenstein64 for your help

1 Like

How did you get this code to work? I’m not sure how to go about it.

I’m making a ship with multiple parts and such so I can’t seem to get it to work.

Thank you! I really appreciate that. I’ll look into it.

1 Like