Unity. Strange behavior of parameters
realtimevfx.com
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 its jumping up or falling down. All my tries to smooth or clamp values didnt 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 didnt give a result.And here is a question. Whats a reason of this behavior of values can be? And how to fix it and to get a smooth values exact as objects movement?Thanks a lot!
0 Comments ·0 Shares ·90 Views