Help with viewport frame and camera positioning

Since I am not so good with roblox instances such as the Camera I would like some help on this one.

How would I get the object or the model to be in front of the camera?

@msix29 tried to help me on this one , but said he wasn’t sure

local ItemMesh = Meshes:FindFirstChild(v)
			
			
			
			local itemgui = game:GetService("ReplicatedStorage"):FindFirstChild("Gui"):FindFirstChild("Template"):FindFirstChild("Item"):Clone()
			local itempic = Instance.new("Camera")
		
			
			itemgui.Parent = InventoryGui
			
			local ItemMeshSize = ItemMesh:GetExtentsSize()
			ItemMesh:SetPrimaryPartCFrame(CFrame.new(0 , 0 , 0))
			
			
		itemgui.Name = v
		itemgui.ItemName.Text = v
			
			itempic.CFrame = CFrame.new(0 , 0 , 0) * CFrame.new(ItemMeshSize)
			itempic.CFrame = CFrame.lookAt(ItemMesh.PrimaryPart.Position , ItemMesh.PrimaryPart.Position)
			
			
			itemgui.CurrentCamera = itempic
1 Like

Hi, Normally the part position has to be 0 in x,y,z axis for it to work.

But if you would like to make it automatically then use this module (it includes rotation of the camera so it makes the part rotate around it self gives it a cool look!)

1 Like

I’ll check it out later if it works, thanks for the reply

1 Like