What do you want to achieve? Keep it simple and clear!
Aim down sight
What is the issue? Include screenshots / videos if possible!
Jitter when moving
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Different methods of manipulation, changing it to be under camera, be moved to cameras cframe with and without tween.
musket:SetPrimaryPartCFrame(camera.CFrame)
the current set of code that moves it to the camera every renderstepped
From the video, it looks like your gun script is rotating joints on your character to position the gun, so when you’re setting the musket’s CFrame again, they’re likely fighting
Yup! He needs to Pivot the model after the camera updates, so he should use RunService:BindToRenderStep, with the priority of Enum.RenderPriority.Camera.Value + 1.
the same problem occurs with less jittering, and the musket is still offset when moving
run_s:BindToRenderStep("ADS_Update",Enum.RenderPriority.Camera.Value+1,function(dt)
musket:PivotTo(camera.CFrame)
-- I tried with and without the Lerp, just to test if it affected the musket offset when moving and it did, i just couldn't eliminate it.
end)
i tried both, problem still presents, however wouldn’t you want it to update the position after the camera updates so it doesn’t move after the fact
This solves the jittering but the musket is still opposite the player movement, i found an alternative solution which was to just find where the camera will be relative to the torso, set the musket to that, and then rotate it from there