ViewportFrame not rendering

Recently, I’ve been trying to add a pets system, but the Viewportframe was meant to render the egg, however, i’m having some difficulties. Here is a snippet of the code:

local player = game.Players.LocalPlayer
local CowEgg = player.PlayerGui:WaitForChild(“Pets”).CowEggFrame

local Cowegg = player:WaitForChild("PlayerGui").Pets.CowEggFrame


local clonedCow = workspace:WaitForChild("CowEgg"):Clone()
clonedCow.Parent = Cowegg
local camera = Instance.new("Camera")
camera.CFrame = CFrame.new(clonedCow.PrimaryPart.Position + (clonedCow.PrimaryPart.CFrame.lookVector * 3),clonedCow.PrimaryPart.Position)
camera.Parent = Cowegg

Cowegg.CurrentCamera = camera

Here is where the cowegg is:
https://gyazo.com/f5d9adfde4ed47288638af27d5f72a28

Any help is appreciated!

Try this:

local Cowegg = player:WaitForChild("PlayerGui").Pets.CowEggFrame


local clonedCow = workspace:WaitForChild("CowEgg"):Clone()
clonedCow.Parent = Cowegg
local camera = Instance.new("Camera")
repeat
wait()
camera.CameraType = Enum.CameraType.Scriptable
until
camera.CameraType == Enum.CameraType.Scripable
camera.CFrame = CFrame.new(clonedCow.PrimaryPart.Position + (clonedCow.PrimaryPart.CFrame.lookVector * 3),clonedCow.PrimaryPart.Position)
camera.Parent = Cowegg

Cowegg.CurrentCamera = camera

This may lag your game beware.