local target = workspace.THEPARTINEED local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target while wait() do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part end
The camera is still but is not looking at the part?
Any ideas?
Scriptable camera will ignore both CameraSubject and Focus. It's whole purpose is to be fully controlled by your own code. This should work:
local target = workspace.THEPARTINEED local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable while wait() do camera.CoordinateFrame = CFrame.new(target.Position, target.Position + target.CFrame.lookVector) end
Right now it will face same direction the part is oriented at, since I wasn't sure where exactly the camera should be located and where it should look.
Also consider using RenderStepped, since wait() is only 1/24 of a second, while roblox renders more often than that. Check these out:
http://wiki.roblox.com/index.php?title=API:Class/RunService/RenderStepped http://wiki.roblox.com/index.php?title=API:Class/RunService/BindToRenderStep
I'd personally use runService:BindToRenderStep()
, otherwise do runService.RenderStepped:wait()
.