Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to parent a CFrame to a object?

Asked by 5 years ago
cam = game.Workspace.CurrentCamera
cam.CFrame.Parent = Character.Head.CFrame

so what i want it to do is constantly become the CFrame of the characters head but when I do it with loops its really choppy and it says that CFrame.Parent is not a thing how can i get this code working so i don't get the error "- Parent cannot be assigned to "

The broken loop method:

while true do
player = game:GetService("Players").LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()

cam = game.Workspace.CurrentCamera
cam.CFrame = Character.Head.CFrame
wait()
end
0
You're trying to set the parent of a property, which will error. "can.CFrame.Parent" User#19524 175 — 5y

Answer this question