the player’s camera isnt set to the camera part when this code is executed, it’s a local script and theres no errors. I tweened the camera part and the part tweens without the camera attached
Well, if it worked slightly in the ScreenGui, then that is a little bit okay… Although to have the Camera manipulated properly, it is essential to put it underneath in StarterPlayer > StarterPlayerScripts or StarterPack.
There is documentation talking about the customization in regard to the Camera that may help you further to understand how it works + its function:
Is this only ran once? Because sometimes it’s set back to Custom automatically, you should run it in a loop.
-- workspace is an alternative to game.Workspace
for i = 1, 100 do -- only runs 100 times so its not infinite
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CameraPart.CFrame
task.wait()
end
Edit : Nevermind, I don’t think you should do this. Try this instead.
local player = game.Players.LocalPlayer
local character = player.Character
local cameraPart = character.Head.CameraPart
local camera = game.Workspace.CurrentCamera
local humanoid = character.Humanoid
local deb = true
You have to set the CameraType back to Track at the end of your script. local player = game.Players.LocalPlayer
local character = player.Character
local cameraPart = character.Head.CameraPart
local camera = game.Workspace.CurrentCamera
local humanoid = character.Humanoid
local deb = true