Hi guys.
The case is: I have a shader graph to move seamless texture changing UV offset using Time.time node. I also have the speed float which is used as a multiplier.
Speed default value is 0, this means I don’t want texture moves on start, but only when I need it. The problem is that Time.time is actual app Time.time, and when I set the speed to required value Time.time won’t ever be 0f and what make the texture UV offset “jump” or too quick (in case if smooth speed lerp) to the value related to current time.
That’s unexpected behaviour - I wish to change UV offset ONLY when speed is > 0f. The first idea I had is to introduce some kind of custom Time.time counter using Time.deltaTime value when speed is > 0f. But I don’t understand how to implement it, if even it is possible.
Any idea how can it be done? Maybe there is some better solution?
For now I use “dirty” workaround substracting Time.time to custom “_StartTime” float which I update before changing the speed. But even this won’t help me in cases when I set speed to 0 and then increase it again - UV offset will return to it’s initial value with same texture “jump” problem.