so i'm making an animation, from a dummy POV (camera is set to dummy head). I'm not so experienced in scripting so i thought i would ask here.
how would i do that? i tried using cframe but it doesnt work.
local camera = game.Workspace.CurrentCamera local dum = workspace.Dummy.Head game.ReplicatedStorage.SetHeadToDummy.OnClientEvent:Connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = dum end)
You need to set the CFrame to the dummy's head CFrame. Since the camera will be constantly moving, you will need to fire it every frame using RenderStepped.
local camera = game.Workspace.CurrentCamera local dum = workspace.Dummy.Head local RunService = game:GetService("RunService") local function updateCamera() camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = dum.CFrame end game.ReplicatedStorage.SetHeadToDummy.OnClientEvent:Connect(function() RunService.RenderStepped:Connect(updateCamera) end)
There might be a better way to do this but this is what I would do. Let me know if this works.