Weld parts to camera without jitteriness

I wanted to know how to weld a part to the camera but NOT have the jitteriness the usual methods provide.

Things ive tried:

  1. Creating a camera subject part and welding the Target to it. Results; High jitter on all camera cframe updates
  2. Setting the Target’s Cframe to the camera subject’s cframe. Results: same as above
  3. Setting the Target’s Cframe onRenderStep. Results: same as above
  4. Setting the Target’s Cframe through BindToRenderStep with high and low priority. Results: same as above
  5. Reducing the Target to a single 1^3 stud and setting its position in render step. Results: same as above
  6. Using TweenService to animate the part’s CFrame to the camera’s/camera subject’s CFrame. Results: Same as above, HOWEVER, it IS smoother. However, upon reaching any higher speeds with the camera will immediately cause jitteriness

I appreciate all help. And no, this ISNT a duplicate question because all other questions like this asked DO NOT address the jitteriness or have already been tried as stated above. Unless you find a different duplicate strategy, please dont comment as dupe. Thanks.

1 Like

I havnt messed too much with cameras however maybe try lerping:

example:

local partToAttach = – your part here
local camera = game.Workspace.CurrentCamera
local lerpingSpeed = 0.1 – Adjust this value for smoother/faster transitions

local function AttachToCamera()
local targetCFrame = camera.CFrame * CFrame.new(Vector3.new(0, 0, -5)) – Adjust the offset as needed
partToAttach.CFrame = partToAttach.CFrame:Lerp(targetCFrame, lerpingSpeed)
end

game:GetService(“RunService”).RenderStepped:Connect(AttachToCamera)

1 Like

Because it is a lerp, it can cause BOTH outcomes; jitteriness or delayed jitteriness. Makes sense when you think about it because a lerp just picks a value/alpha that you specified between the two inputs. So either, im delaying the position set which causes delayed jitter, or im setting the position immediately with an alpha closer to 1. which causes instant jittery.

I very much appreciate the attempt!

yeah that actually makes sense mybadmybad

1 Like

Oh yea, I forgot I made a script that already does this! For some reason, the secret is to set the target GUI to the CurrentCamera’s GetRenderCFrame().

Looks something like this:

game:GetService("RunService").RenderStepped:connect(function()
  GuiYouWantAttachedToCamera.CFrame = workspace.CurrentCamera:GetRenderCFrame():ToWorldSpace(
CFrame.new(POSITION OFFSET)  *  CFrame.Angles(
math.rad(X ORIENTATION),
math.rad(Y ORIENTATION),
math.rad(Z ORIENTATION)
  )
)
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.