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().
3 comments
Thank you very much but it doesn't work :/ It just locks the camera on the player.
Hm, I guess you set the target to player's head? Well, that is what it should do, look at the part. At least that's what I understood from your post.
Yeah, although I copied it exactly and it locked it to the players head and not the part :/ I will carry on trying to figure it out..