Reputation: 1866
I have several shaders that use the Time node to animate certain UI elements for my mobile game. In certain cases (which I am unable to reproduce), the shaders will be stuck on a specific time and not animate.
For example, a shine shader might be stuck mid-shine.
Some important things to note:
Time.timeScale
is 1 - all my tweens using scaled delta time are working correctlySample shader - The preview actually looks exactly like the issue as it will appear in game when frozen:
Upvotes: 0
Views: 4616
Reputation: 1866
For any lost souls who stumble upon this issue (although I doubt it's by design as it seems like a bug).
The problem is that time isn't updated in shaders in scenes without a camera. The camera doesn't have to render anything; it just needs to exist.
My main menu is pure UI elements and had no camera; adding a camera to the scene fixed the issue.
It is important to note that this behavior only happens once you build to an Android device; not sure if it reproduces on other platforms.
Upvotes: 3