I have tried to fix this before I posted it but basically I want to have it to where it focuses on a certain part and be a certain distance away. But it isn't doing a single thing other than outputting "Focus and Coord set!". No errors what so ever. Here is the code:
-- Time for a huge script! -- Wait For Crap -- while game.Workspace.CurrentCamera == nil do wait() end local cam = game.Workspace.CurrentCamera -- Libraries/ModuleScripts -- --local camera = require(script.CameraPlus) --local Module3D = require(script.Module3D) cam.CameraSubject = nil cam.CameraType = "Scriptable" -- Putting the camera at a certain CFrame coordinate and focus. -- cam.CoordinateFrame=game.Workspace:WaitForChild("ShopCamera").CFrame cam.Focus = game.Workspace:WaitForChild("Part").CFrame print("Focus and Coord set!")
Thank you so much for helping! I very much appreciate it!
You're trying to run the script before the client has loaded, put a wait()
on the first line
Also:
Scriptable camera is different from regular camera types, you can only set the coordinate frame with scriptable, but can set the focus within it:
cam.CoordinateFrame = CFrame.new(CoordinateFrame, Focus) -- You can only set CoordinateFrame, but lookvector plays a role.
So to put it in use for you:
cam.CoordinateFrame=CFrame.new(game.Workspace:WaitForChild("ShopCamera").Position, game.Workspace:WaitForChild("Part").Position)