Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I have tried the two solutions that you provided but they did not resolve the issue. However, I did some more testing and my initial guess as to what the issue was is wrong.

The first thing I found was that it is almost an asset wide issue that happens when the bug occurs. It's not just the STM on the canvas that is being animated that can disappear.  Even STM on other canvases, in other scenes, that have no connection to the animated canvas can disappear at the same time.

I then narrowed down an instance of the issue happening to an animation event that I had on the animation, as it would happen whenever the event was present but did not reoccur after I removed it. The animation event triggered some code that would enable Game Objects that have STM components in their hierarchy.  These Game Objects are children of a canvas that's Game Object is enabled over the course of the animation.

I tried multiple things to resolve the issue, such as removing the animation event and enabling the Game Objects in code manually before playing the animation, moving the animation event until after the Canvas's Game Object was active, and setting the Canvas's Game Object to be active for the entirely of the animation. However, even if these solutions worked once, upon triggering the animation multiple times it would normally break again.

Because of this new information, my best guess is that it has something to do with setting an STM component active when a parent Game Object is inactive, or maybe that in combination with the animation system is causing a sequence issue. It is also really strange that it affects even completely disconnected STM components. Although, if there are shared systems or data between all STM components then maybe that could help narrow down the root of the issue.

While I could maybe find a work around to this problem by just blindly trying stuff until something works, I really would like to either get a solution or understand the issue enough that I'm not guessing at least. Any help you could provide would be greatly appreciated. Sorry that I can't show the game/problem directly, but I can give more details if that'd be helpful and can maybe try to replicate the problem in a different context if necessary.