Tried to use viewportFrame in A MODEL (wich is an npc) but it keeps showing errors

local p = workspace:WaitForChild("T1")
local vpf = script.Parent
local pp = p.PrimaryPart

local cp = p:Clone()
cp.Parent = vpf

local viewportCamera = Instance.new("Camera")
vpf.CurrentCamera = viewportCamera
viewportCamera.Parent = vpf
 
while true do
    wait()
    viewportCamera.CFrame = CFrame.new(Vector3.new(0, 2, 12), pp)
end

1 comment

0

I couldn't get a position of the model so i had to use primaryPart