So i have this script where it moves the part, but the part(cam) is very glitchy as a move the player around the map, is there anyway to fix this? The script is in serverscriptservices. the part is a regular part in workspace. Pls help.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Char)
local cam = game.Workspace.CameraPart --the part
while true do
cam.Position = Char.HumanoidRootPart.Position + Vector3.new(0, 5, -10)
cam.CFrame = CFrame.new(cam.Position, Char.HumanoidRootPart.Position)
wait()
end
end)
end)
Basically how you can use tweenservice is, instead of setting the cam.CFrame like so, do it using tweenservice.
Also, this is very important. When moving the camera, make sure to set the CameraType to scriptable. This might have been your issue. You can do it like this: cam.CameraType = Enum.CameraType.Scriptable. And when you want the camera to be back to normal, do: Enum.CameraType.Custom.