I have a script that makes the camera move to an attachment on a part
local UIS = game:GetService("UserInputService")
local RNS = game:GetService("RunService")
local camera = workspace.CurrentCamera
local part = workspace:WaitForChild("Sight")
local sight = part:WaitForChild("sightAttachment")
local originalCFrame = camera.CFrame
local aiming = false
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType == Enum.UserInputType.MouseButton2 then aiming = true
camera.CameraType = Enum.CameraType.Scriptable
task.spawn(function()
while aiming do
camera.CFrame = sight.WorldCFrame
RNS.RenderStepped:Wait()
end
end)
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton2 then aiming = false
camera.CameraType = Enum.CameraType.Custom
camera.CFrame = originalCFrame
end
end)
and I have another script that makes the character rotate while aiming down sights the problem I’m having is the pivot needs to line up exactly with the attachment or it won’t work the attachment is also sideways and if I align it the camera breaks even more
If anyone has more questions I can give more info or more screenshots thanks