I want to be able to hide a widget when it is not appearing to the player in the scrollbar, I want to be able to change its visibility so as not to lose so much fps if I have many slots in my inventory. I’ve been wondering if a retainer box with a fade material would help?
In green the limit that I want to be able to show. In red are the rendered widgets that I want to be able to hide until the player starts to scroll down further.
Retainer would make everything slower. You still have your widgets but now push them through a render target.
Also, this should not impact performance unless you have 100s (1000s?) of widgets. Are you sure the performance hit comes from the number of widgets rather than from something the widgets should not be doing? Ticking? Function binding? Looping queries?
If you need to deal with hundreds or thousands of widgets, do look into Tile View. This container automatically keeps only a handful of widgets alive, creates and releases them on the go.
Yes, you’re right, it’s only at 500 slots that performance starts to get worse. With less it is quite ok to use the slots. And yes, I use function bidding, loop queries and it’s quite ok with high numbers, but it’s only when I open the inventory that the fps drops and recovers, I’m going to try to fix this with “Tile view”. My point here is that I’m making a customizable inventory system, so people can use multiple slots, but I’m going to put a limit. I’ll take a look at the “Tile view” too and come back with more information if I need help. Thank you very much for your help, @Everynone.
Ps: Sometimes you seem like a God because I always see you in every post to help people. This is amazing, thank you very much for your help and for the help you give to the rest of the people.