How would I go about making a script that will create the same CFrame as a part I want the camera to lock on? I tried using CameraSubject
but I think I used it in the wrong way. Anyways, how would I make the script?
Set camera cframe (in localscript) like this:
local function ShowMe(part) workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position, part.Position) end ShowMe(workspace:FindFirstChildWhichIsA("BasePart", true))
Note that in order to 'lock' onto a part, you'll need to make a loop, something like:
local part = workspace:FindFirstChildWhichIsA("BasePart", true) local locked = true while wait() do repeat if part then ShowMe(part) end game:GetService("RunService").RenderStepped:wait() until not locked or not part end