Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Outline/shadow scripts not changable via animation

Discussion in 'UGUI & TextMesh Pro' started by TheVastBernie, Nov 14, 2014.

  1. TheVastBernie

    TheVastBernie

    Joined:
    Mar 25, 2014
    Posts:
    10
    Hey, I asked this already in answers but new questions keep coming too frequently and I think this topic is also suited for the forums.
    I'm using UGUI buttons with an animation as transition. With the animator controller I'm able to modify almost every value, except for the UI.Outline script, which does not seem to work properly. Trying to animate the effect distance does occasionally work, but most often it will just do nothing, leaving the outline at the original state. I've even tried the UI.Shadow script with the same outcome. The values in the inspector are displayed and animated properly, the outline is just not changing. If I modify the values through a script however it seems to update properly. In theory I could link up a script with the outline effect to get what I want, but that seems like a terrible hack for a problem that shouldn't really exist.

    My question is, has anyone experienced this issue before? Is it a bug, will it be fixed? Or am I just missing something obvious here?
     
  2. itsa

    itsa

    Joined:
    Feb 4, 2014
    Posts:
    10
    I had this problem too with shadow script.
     
  3. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    Have you tried to call "SetVertexDirty" or "SetMaterialDirty" on the UI.Graphic every frame when playing the animation? We had similar issues we "fixed" doing this.
     
  4. TheVastBernie

    TheVastBernie

    Joined:
    Mar 25, 2014
    Posts:
    10
    That would fix it, but then I could also write a script to update the effect distance directly. The main problem is that we have to rely on a extra script for something that the shadow scripts should handle internally...
     
  5. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
    My "me too" comment. 4.6.4f1

    It seems to be getting confused between the Outline and the Shadow effects, and finally no matter how one you choose, it always end up applying the effect to the Outline in my case (although it maybe it is because Outline is before Shadow in the component list).
     
  6. stefan_s_from_h

    stefan_s_from_h

    Joined:
    Nov 26, 2017
    Posts:
    72
    Still a problem with 2018.2.18f1. But changing the order helped as I only needed to access the shadow properties for an animation.