Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

What could cause a <w> animation to stop playing part-way?

A topic by Scarlet String Studios created 43 days ago Views: 96 Replies: 8
Viewing posts 1 to 9
(1 edit)

I have a project-specific bug that I'm trying to untangle, and I'm not totally sure if the issue is in my own code or if it's in STM.

I have a piece of text that's animated with a custom wave, like <w=myWave>. It displays properly when it's first shown to the player and in the editor. But, when I load that same text from the player's save file in build, the text isn't animated — and it looks like it got frozen mid-animation.

You can see how the name "kameleon1c" appears to be frozen at different stages of the wave.

Anyway, is there any situation where this would be intended behavior? At first I was thinking that perhaps the <w> tag got removed or renamed when loading the string from the save file. But, according to my testing in the editor, it looks like removing the <w> causes the string to render normally, even if it was mid-animation. Also, it's worth noting that this works correctly in the editor — I'm only getting the problem in the build.

I haven't been able to reproduce this elsewhere, so it might have something to do with the whole setup that it's part of, which involves a vertical layout group and probably multiple rebuilds. So, I'm trying to figure out what situation could cause this in the first place.

Developer

Hmm... is Rebuild() being invoked when reloading? It could be that the variable that tells text to animate isn't being triggered somehow... Does enabling "force animation" make any difference for you? When text rebuilds, STM has an internal timer it keeps to animate text, so something may not be updating.. somehow.

Yeah, Rebuild() is being called. I can't remember how the whole process works, but it's probably being rebuilt at least once when the text is set, but possibly more than once if the vertical layout group or some other code changes the rect transform's size or the font's size.

I just tried again with force animation, and it's still not working. Makes sense that perhaps a timer is being stopped somehow, though.

Developer

I'll give it a close look this week! Thank you so much for your patience

Sounds good, thanks!

Actually, this reminded me of a similar problem that I had in the past with a different <w> effect, and I just noticed that I'm still getting this problem in build (not in editor). The problem occurs the first time the menu is shown, but it gets fixed if I close the menu and reopen it, so it probably has something to do with Rebuild().

This other one would be easier to reproduce, so I can try and copy some prefabs over to a demo project later. But either way, it looks like there's something that can situationally cause an animation to stop, which (as far as I know) isn't intended.

Developer

Would it be okay to have a look at your loading code? If the <w> tag is being sent to STM, and then STM is rebuilding... it *should* be animating... Is there anything going on with timeScale in your game, maybe? Is there a difference if "ignore timeScale" is enabled in STM? It's enabled by default so it may not be that, but it's worth checking!

Hey! Actually, I was able to reproduce this in a testing project, so I'll go ahead and email that to you. I just copied over some prefabs and scripts from the main project. Near the end of the convo, you'll see the word <w=glitch>and</w> — it gets animated in the editor, but not in build for me.

Developer

I got the email! Will give it a look soon!

Developer (1 edit)

Just to finish off this thread, (I know, I haven't been marking threads as "solved"...) we discussed further through email, and this should now be fixed as of 1.13.3!