Get player camera to be a parts

Hello, I’ve tried everything and this still doesn’t work, I am trying to get the player camera to be a part, every single dev forum post solution doesn’t work for me.

local camera = workspace.CurrentCamera
local part = workspace.CameraPart

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part.CFrame

Instead it locks in at the spawn without any reason.

Anyone know what the problem is?

The script is local

2 Likes

Works fine for me, make sure you use a WaitForChild for the part and are using a local script

1 Like

Adding a repeat wait() until loop will ensure that player camera type is indeed scriptable.
Please make sure that the script you are using is a LocalScript otherwise I don’t think you can change CameraType enum (not sure) as well as Narzic mentioned to use WaitForcChild for part

local camera = workspace.CurrentCamera
local part = workspace:WaitForChild("CameraPart")

repeat wait()
	Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = part.CFrame
1 Like

The camera still locks at spawn

Do you have any errors in Output?

CameraPart is not a valid member of Workspace “Workspace”

The error you are experiencing states that “CameraPart” is not in the workspace.
Please make sure the part you want to set a camera at is inside Workspace

image
It is

It is a little illogical that it says “CameraPart is not a valid member of Workspace “Workspace”” as if you would use :WaitForChild("CameraPart") it would drop a different error. Could you send me your current version of code?

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