Viewport Frame moves hats from HumanoidDescription to the Primary Part CFrame

Basically, this is my script

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ViewportCamera = Instance.new("Camera", script)
ViewportCamera.CameraType= Enum.CameraType.Scriptable

local Item = ReplicatedStorage.Dummy:Clone()

local HumanoidDescription = ReplicatedStorage.Skins[script.Parent.Parent.Parent.Background.Title.Text][script.Parent.Name]:Clone()

local ViewPortPoint = Vector3.new(0,0,0)

script.Parent.LightDirection = Vector3.new(0, 1, 0)
script.Parent.Ambient = Color3.fromRGB(255,255,255)
script.Parent.CurrentCamera = ViewportCamera

Item:SetPrimaryPartCFrame(CFrame.new(ViewPortPoint))

local cfrane, size = Item:GetBoundingBox()

local Max = math.max(size.X, size.Y, size.Z)
local Distance = (Max/math.tan(math.rad(ViewportCamera.FieldOfView))) * 0.4

ViewportCamera.CFrame = CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0) * CFrame.new(ViewPortPoint + Vector3.new(0, 0, ((Max/2)+Distance)), ViewPortPoint)

Item.Parent = script.Parent

Item.Humanoid:ApplyDescription(HumanoidDescription)

I dont wanna get much into explaining, so i’ll try my best to outline visually whats going on:

PrimaryPart: Head

image

PrimaryPart: UpperTorso

image

PrimaryPart: RightFoot

image

why is this happening and how do i prevent it