ViewportFrames are an epic addition to roblox!
If you’re trying to create icons for different furniture/weapons etc. you dont have to create and upload a new decal for every single item in your game, you can just use a viewportframe.
The issue
Altho handy, it has some flaws.
- Every client needs to render the icons.
Having inventory, toolbar etc. This gets unnesscarily expensive and complex overtime.
Assume you destroy the menu while the player is playing, this would demand a new render for all objects. - Slows down player access time
ViewportFrames require all models of which you want rendered to be accessable to the client so all tools, furniture etc. needs to be in ReplicatedStorage and thus slows down the time it takes for a player to join a game. - Difficult to work with ViewportFrames
Having to copy a model, setup a camera, fix correct lighting properties just for a simple image can easily get messy. To have the icon at two places (inventory and toolbar for example) require you to have knowledge of it’s camera and lighting settings. Much more complex than a simple textureid.
The solution
I want to suggest a function for the viewport frame that lets you preload an image and use it as a normal texture ingame anywhere.
Example:
local textureId = ViewportFrame:GenerateImage(400)
tool.TextureId = textureId --Or imageLabel.Image = textureId
This way you could preload all your weapons, furniture icons once the game starts and then never having to render them again.
I’m sure alot of these issues can be solved by some complex code structure, but my point is that having a textureid is so much simpler and easy to use for beginners aswell as “senior roblox citizens”.