Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animating UI material properties?

Discussion in 'UGUI & TextMesh Pro' started by casimps1, Mar 12, 2015.

  1. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    Anyone know how to do it?

    Say I create a Material whose shader exposes a property called BlurDistance. If I apply that Material to a simple Cube GameObject, then I can create an animation for that Cube with keyframes on the BlurDistance property.

    However, if I apply that same texture to an Image (the 4.6 UI component), and try to animate that, BlurDistance is not exposed.

    It seems a bit odd to me that this is exposed in the first case but not the second.

    If this is by design, do I need to create some new property for the animation to keyframe off of and then just use the setter of that property to set BlurDistance?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    I don't think animation can touch material properties. But I would have thought you could hook up a public property on a script and have that feed in to the material on update. Public properties are full animatable.

    Any ideas @Aras ?
     
  3. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    242
    Has anything changed about that ?