I have a viewportFrame inventory Gui, that uses RenderStepped to spin the camera around the item in the viewport.
I was wondering:
Is it better to have 1 handler script, that takes care of ALL the items and viewports, or have a new script inside every viewportFrame, that handles that item and its viewport preview?
With 140 items, the script usage is around 6%, which is not great.
I already have optimization measures, such as:
- RenderStepped loop gets disconnected when inventory is closed
- The viewports update only if they are visible on the screen
Changing my script to 1 per item wouldnt be an issue, and it would also help with another problem.
Any help?
EDIT: I made a script for each viewport, and the script usage dropped only by 0.25%, but it also fixed a issue with the usage getting bigger with each item you select.