Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Camera not changing CFrame?

Asked by 1 year ago
Edited 1 year ago

Trying to put the camera's position based on a part's CFrame but it is not working properly. I am not too sure why though, it does not error and it seems to me that it "worked" without actually changing anything, even though it should of. The camera does not change at all, it stays on the player. It is a local script in StarterPlayerScripts, the local script is running at the start of the game but does not change my camera. I've tried adding delays, putting it in startercharacterscripts, nothing changes the camera. Is there something I am missing?

local cam = workspace.CurrentCamera
local part = workspace:WaitForChild("Part")

cam.CFrame = part.CFrame
cam.CameraType = Enum.CameraType.Track
0
try putting line 5 before line 4 and setting the camera subject greatneil80 2647 — 1y
0
I think this post will be really helpful to people because a few types of games do require this! Puppy_lovertheawsome 84 — 1y

1 answer

Log in to vote
1
Answered by 1 year ago
local cam = workspace.CurrentCamera
local part = workspace:WaitForChild("Part")

cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = part.CFrame
Ad

Answer this question