How to easily make a shop using Viewport Frames?

Hello developers! I’m working on a shop for my game and I need to make a shop with images a little bit like this in My Restaurant :

My problem is that I don’t really want to make a viewport frame for each of my 72 objects that I have to put in the shop. Also, I’d like them all to be oriented in the same way, as in the example image.
If you have any solution, that would help me a lot!

2 Likes

Create a script to generate an element for every item. Place your items in the same spot, like Vector3.zero for example. Then, place a dummy item in the starter element’s viewportframe, and link it to the studio camera. Make it look the way you want. Then clone the camera and copy its CFrame to a part. Add it to the elements container. The script should link each element to a new camera at the same CFrame as the part. If an item faces the wrong way by default, just rotate it.

3 Likes

Cool! I’ll give it a try! I’m bad at scripting, so do you have a script like you said? :slight_smile:

I do but I’m on my phone so I can’t get it right now. Also that Script is for a building system, but I guess I can make a new one…

script.Archivable = false

local element = script.Parent
local items = game:GetService("ReplicatedStorage").Items
local camera = Instance.new("Camera")
camera.CFrame = element.Parent.CamCFrame.CFrame
camera.Parent = element.Parent

for i,v in items:GetChildren() do
local newElement = element:Clone()
newElement.Title.Text = v.Name
v:Clone.Parent = newElement
newElement.CurrentCamera = camera
newElement.Parent = element.Parent
end

element:Destroy()

This is an exaple based on a specific explorer layout.

5 Likes

Okay, thank you very much! It will helps me a lot!

It works! Thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.