Hello community!
I faced with something not abvious during making a vertex animation in shader graph.
The goal is to bend texture as more as faster object is moving. I took a speed of game object by the script ((current position - previous position)/Time.deltaTime) and returned its value in the material property which use in shader further.
And when the object starts to move my texture starts to bend but with jerky behavior. I expect increasing value from 0 to some positive maximum. But sometime, at some frames it’s jumping up or falling down. All my tries to smooth or clamp values didn’t give a result. Then I decided to look at values of the speed that I got from the script. I found that it changing not linier. You can find it on the graph (attached).
At first I thought that my “speed getter” should be in FixedUpdate method. But change the method didn’t give a result.
And here is a question. What’s a reason of this behavior of values can be? And how to fix it and to get a smooth values exact as object’s movement?
Thanks a lot!