Hello, I am currently trying to make a shop gui that has, what ive called, cards that have a viewport frame in each that shows a view of the item that that card is resembling. However, I am not very good at using viewport frames and currently I can not work out how to get the views on all the cards to look the same. Here is what currently happens:
2 Completely different views.
This is what I want it to look like: (This pic is edited)
This is my current script:
local UICARD = RS:WaitForChild("Templates"):WaitForChild("Card_Temp"):Clone()
UICARD.Parent = script.Parent:WaitForChild("BG"):WaitForChild("Cards")
UICARD.Name = v.Name
local CardInfo = UICARD:FindFirstChild("INFO")
local RodViewport = UICARD:FindFirstChild("RodView")
local viewportCamera = Instance.new("Camera")
viewportCamera.Name = "Cam"
viewportCamera.Parent = RodViewport
RodViewport.CurrentCamera = viewportCamera
local RodClone = v:Clone()
RodClone.Parent = RodViewport:FindFirstChild("WorldModel")
RodClone.PrimaryPart = RodClone:FindFirstChild("Handle")
local cframe, size = RodClone:GetBoundingBox()
local position = cframe.Position
local offset = Vector3.new(size.X * 0.4, size.Y * 0.2, size.Z * 2.5)
viewportCamera.CFrame = CFrame.lookAt(position + offset, position)
UICARD:FindFirstChild("RodName").Text = v.Name
CardInfo:FindFirstChild("Range").Text = "Range: " .. tostring(v:FindFirstChild("Config"):FindFirstChild("Range").Value)
CardInfo:FindFirstChild("MaxRarity").Text = "Max Rarity: " .. tostring(v:FindFirstChild("Config"):FindFirstChild("MaxRarity").Value)
UICARD:FindFirstChild("Buy//Equip"):FindFirstChild("Price/EquipDisp").Text = "BUY: " .. tostring(v:FindFirstChild("Config"):FindFirstChild("Price").Value) .. "$"
Any help would be much appreciated!