Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Ok, update...


First, Is this the type of setup you're describing? I'm trying this in an old Unity version (My main development project for STM) so it could be something unique to a newer version, but I just want to see if I'm on the same page or not:



The bit of lag I see here seems typical for multiple prefabs getting edited, but from what you described you're seeing something a bit more than this, so is this type of setup correct, but just with a *lot* more text? Additionally, I tried this both inside and outside of Unity UI and didn't see a difference in UI text - if anything, the UI text had better performance than the above gif? So will try in Unity 6 soon.


Second, I went ahead and wrote the auto pagination script, but I don't actually see a visible performance boost on my end vs. just editing a normal text mesh, but I'm going to share it regardless:

https://pastebin.com/UReTwUEf

You just attach this as a component to an STM object and it sets up others like this:


There's an option to automatically grab the amount of lines from the text mesh, redo the layout if the amount of lines changes, and the amount of lines each STM object will render. It's useful, but I unfortunately don't think it'll be the answer to this problem just yet. Worth a shot, though.


So I will try it in Unity 6 soon, but I want to make sure I'm understanding the problem correctly as I'm not seeing any locking up on my end just yet? I feel like I must be missing something obvious, sorry I've been bouncing between so many different projects and I might be getting stuff mixed up.

I'm getting strange results when testing.  If I drop a prefab with a moderate amount of text into the scene, I get "normal" lag until I edit the text, at which point it starts locking up.  Then if I unpack the prefab, it's back to normal.  The more text I add to the prefab (beyond the amount initially there), the slower it gets.  I recorded a video demonstrating this - do you have a support email I can send it to?

The one consistent thing is:  whenever the text in the STM text box turns bold, it starts locking up unity.  When I edit the text as described above, it turns bold and this happens.  For my tutorial prefab, I notice it's already bold when I try to edit it, meaning everything is super slow right from the start (even just opening it in prefab mode).

As for the auto pagination script: I couldn't get it to work.  If I set it to auto it does nothing.  If I click manual setup, it creates one empty STM object.  I couldn't get it to overflow text into other objects no matter how much text I added.

Hm, so it's when you have a prefab, and then change the text in the scene to be different... When I do that from the state of the .gif above (clicking the the first object, editing text) The text does turn bold, but I'm not seeing any performance issues quite yet, so maybe it's a version thing...?


I did just find and fix another bug that could potentially cause a UI layout to rebuild far too often (or not often enough), so there's a slim chance *that* could be the cause, but I didn't apply it to my test project yet or anything, just another bug I fixed.



The autosplit script needs "STMPagination" in your project, which can be found in the sample scenes - I don't think the script would have compiled without it, but if it's creating just one empty object, it's either set to only create one with one setting or another, or an error is happening and it's stopping. Could I see your inspector? Mine looks like this:



It's really just meant for setting up STMPagination in a "page" format like this, the STMPagination script can be used on its own to have overflow text go to another STM component, like once the objects have been laid out, the script could be deleted. I wasn't able to reproduce an error when adding the component to an STM object on my end, but it's an editor script I just wrote, so I might not be accounting for every use-case quite yet.