I am trying to make an egg hatching system. Everything works perfectly until i put the pet into the viewport frame, it appears very small. Im not sure whats wrong.
This is my script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage.EggStuff:WaitForChild("CapsuleBought")
local TweenService = game:GetService("TweenService")
local localplr = game:GetService("Players").LocalPlayer
remoteEvent.OnClientEvent:Connect(function(plr)
script.Parent.Enabled = true
local viewportFrame = game.ReplicatedStorage.EggStuff.ViewportFrame
viewportFrame.Parent = script.Parent
local part = game.ReplicatedStorage.EggStuff.Egg:Clone()
part.Position = Vector3.new(0, 0, 0)
part.Parent = viewportFrame
local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame
viewportCamera.CFrame = CFrame.new(Vector3.new(0, 0, 5), part.Position)
local tweenInfo1 = TweenInfo.new(.25, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local tween1 = TweenService:Create(viewportFrame, tweenInfo1, {Rotation = 9})
local tweenInfo2 = TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local tween2 = TweenService:Create(viewportFrame, tweenInfo2, {Rotation = -9})
local tweenInfo3 = TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local tween3 = TweenService:Create(viewportFrame, tweenInfo2, {Rotation = 0})
wait(.5)
tween1:Play()
wait(.25)
tween2:Play()
wait(.5)
tween1:Play()
wait(.5)
tween2:Play()
wait(.5)
tween3:Play()
wait(.2)
part:Destroy()
local pet = game.ReplicatedStorage.EggStuff.Minions.Noob:Clone()
pet.Parent = viewportFrame
part.Position = Vector3.new(0, 0, 0)
viewportCamera.CFrame = CFrame.new(Vector3.new(0, 0, 1), pet.Head.Position)
viewportFrame.CurrentCamera.CFrame = viewportCamera.CFrame
end)
sorry about how messy the code is