0
Answered

[HELP] Custom Parameters not working with Unity animation

Hann 6 years ago updated by jackielo 6 years ago 3

Hi,

I try to use Unity animation to set keyframe for the custom parameter I created in ShaderWeaver, but its not working.

It would be nice custom parameter able to set on animation keyframe, it save time and effort compare with writing a script. 

Answer

Answer

Yes, you are right. Unity animation does not work for UI. I will declare it in the Q&A section.

However. You can still animate them via 

2. 3rd party tools. DoTween/PlayMaker/Bolt...
3. Scripts. Such as Material.SetFloat
https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Material.SetFloat.htm

Thanks!

Answered

The examples 'Vanish' and 'Card Border' in Shader Weaver use Unity animations. Please check them.

It should work. Once you see parameters in the material inspector. They are just common material parameters.


Please check:

Animations use for component Animator or Animation are different.

Here I tried 3 kinds of renderers:

  1. Mesh Renderer (Unity Animation working)
  2. Sprite Renderer (Unity Animation working)
  3. Canvas Renderer (Unity Animation not working)

I also tried change the Shader Type to UI, also doesn't works.

Answer

Yes, you are right. Unity animation does not work for UI. I will declare it in the Q&A section.

However. You can still animate them via 

2. 3rd party tools. DoTween/PlayMaker/Bolt...
3. Scripts. Such as Material.SetFloat
https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Material.SetFloat.htm

Thanks!