DModelPanel - Not showing in HUD

Well I’m trying to add the DModelPanel to my HUD but I’m not sure why it’s not working.


local function PlayerModel()

	PlayerModel = vgui.Create("DModelPanel")
	function PlayerModel:LayoutEntity( Entity ) return end
	PlayerModel:SetModel( LocalPlayer():GetModel() )
	PlayerModel:SetPos( 2, ScrH() - 102 )
	PlayerModel:SetSize( 100, 100 )
	PlayerModel:SetCamPos(Vector( 16, 0, 65 ))
	PlayerModel:SetLookAt(Vector( 0, 0, 65 ))
	PlayerModel:ParentToHUD()
   
	timer.Create( "UpdatePlayerModel", 0.5, 0, function()
			if LocalPlayer():GetModel() != PlayerModel.Entity:GetModel() then
					PlayerModel:Remove()
					PlayerModel = vgui.Create("DModelPanel")
					function PlayerModel:LayoutEntity( Entity ) return end         
					PlayerModel:SetModel( LocalPlayer():GetModel())
					PlayerModel:SetPos( 2, ScrH() - 102 )
					PlayerModel:SetSize( 100, 100 )
					PlayerModel:SetCamPos(Vector( 16, 0, 65 ))
					PlayerModel:SetLookAt(Vector( 0, 0, 65 ))
					PlayerModel:ParentToHUD()
			end
	end)

end
hook.Add("InitPostEntity", "PlayerModel", PlayerModel)

Any help would be appreciated, thanks!