Search code examples
unity-game-engineshader

Animate scale of an object in the new shader graph system in Unity


I am trying to learn about the new Shader-graph tool in Unity, and want to replace some of my C# coded animations to a shader animations.

But I can't figure out which nodes I need to use. I am trying to create a scale animation which scales the object between 2 values (90% of it's original size, and 110% of it's original size).

I have found This tutorial that shoes how to scale the object, but it lacks some of the things I need. I have added a Remap node to remap to sin of time to be between 0.9 and 1.1 but I can't find any way to set the animation speed.

How can I implement this kind of animation, if even possible, in shader graph?

What am I missing?

This is my current setup: This is my current setup


Solution

  • Finally found the answer I was looking for.

    And to be honest it wasn't that difficult...

    The final graph