Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to move camera using CFrame (script not working)?

i have this script:

view source

i have this script:


	local cam = game.Workspace.CurrentCamera
	local FocusPart = game.Workspace.CamPart
	 
	local player = game.Players.LocalPlayer
 
 
	cam.CameraType = "Scriptable"
 
	 
	cam.CFrame =CFrame.new(FocusPart.CFrame,FocusPart.CFrame,FocusPart.CFrame)

it adjusts the camera but not where i want it to be for some reason the camera goes way to the right of where i want it to be

1 answer

✓ Accepted answer

Maybe try using this:

local cam = game.Workspace.CurrentCamera
local FocusPart = game.Workspace.CamPart

local player = game.Players.LocalPlayer


cam.CameraType = Enum.CameraType.Scriptable


cam.CFrame =CFrame.new(FocusPart.CFrame,FocusPart.CFrame,FocusPart.CFrame)

Try using Enum a little more!

4 comments

0

ok

0

same result the scriptable part is fine but the CFrame part is not working

0

hmm

0

maybe it could be because the camera cframe stays in the position it was at forever idk

This discussion is preserved as it was. New answers, comments, and votes are closed.