hello every1 !! This may be a dumb question but what are some work-arounds for the 31 highlight limit? before anyone suggests it, i can’t put all the parts in one container, the outlines around individual parts are necessary in this game that i’m working on, it’s a game where you paint the individual parts in the map and before they are painted they are all the same color which is really unhelpful and the highlights are the perfect fix but there are way more than 31 parts in the entire game… . thanks in advance<33
Your best option is to remove highlights if the instance is not in the view of the player. Attach this check to RunService.RenderStepped
to make sure it runs every frame. Get the instance’s position on the screen to determine if the highlight is in the viewport. If it’s not, either get rid of the highlight or move it to a storage (repeated instance creation can be heavy on performance).
If you have more than the limit on your screen at a time, tough luck. There’s not a workaround in that case.
thanks i thought so… i dont think i’ll do that though since i dont want to constantly create/destroy multiple instances every frame . sucks that the limit is so low haha but i guess i could try making it so that it only highlights the part that the mouse is hovering over!!
Use Adornee on the highlight instead of parent. Set the parent to a storage location in Workspace and just use Adornee. This avoids creating and destroying it constantly. Just change the Adornee if the Adornee set is no longer in the viewport.
Consider using CollectionService to tag everything that should be highlighted. Then use that to check what is in the viewport and apply the maximum possible highlights via Adornee. CollectionService will let you add and remove tags as needed so you still have control over the highlights through the actual instance you want to highlight.
This is specifically for parts, but it is a similar concept of using a storage instead of deleting parts: PartCache, for all your quick part-creation needs
yeahh thanks but i thought abt it and i dont think its worth the performance decline , especially once i work on my map even more. maybe i’ll use that in a different project tho!!
Adornee on the instances with CollectionService is your most performant option to get around the limit without sacrificing visual effect.
Roblox already has to determine what is on screen to render so it already knows what is in the viewport in the background.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.