Search Unity

Question Material properties get reset and locked on entering play mode if they are used in any animation

Discussion in 'Animation' started by Kreic, Dec 12, 2020.

  1. Kreic

    Kreic

    Joined:
    Sep 2, 2013
    Posts:
    1
    Hello! I've been having this issue for over a week and a half, and I still can't figure out why it's happening or how to fix it.
    I'm using Unity 2018.4.20f1, the nature of the project I'm working on (VRChat avatar) means I can't use a different unity version for now, and that I can only use Animators, layers and parameters for the features I'm working on.

    The issue:
    When I use animations to change material properties, those properties are expected to be locked with the values they had while on the scene once the model enters play mode. During play mode, they can't be changed using the inspector, but they can be changed by using the animations in the animator. All of this is expected because that's how things work as far as I know. The problem is that in some cases, those materials do not get locked with the values they had while on the scene; they get reset to 0 (if they're numeric), unchecked (if they're check boxes), or black (if they're colors). So far I have not found out a solid reason of why it happens, and how I could fix it.

    Video of it happening:



    As you can see, it happens with some materials, and not with others, I tried experimenting on this and turns out it keeps happening even if they're using the same shader that works in a different model, so I don't even know if it's a shader script issue, an animator issue, a model import settings issue, a naming issue, or even a texture issue (I heard disabling mip maps could help, but it didn't work) I know a way to avoid/override this would be to make a "default" animation for those material properties, but I can't use that workaround for this kind of project.
    Thanks for reading! hope there's a way to fix this