Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted GameObject animation reverts to prefab default at after script modification @ runtime

Discussion in 'Animation' started by Keita-kun, Apr 6, 2021.

  1. Keita-kun

    Keita-kun

    Joined:
    Aug 20, 2017
    Posts:
    29
    Hi everyone,
    I have a prefab that contains an animation of a TextMeshPro gameobject, the containning gameobject has a setup script that modifies the material of the TMPro chikd gameobject (script works fine). Actually when the OnTriggerEnter event occurs the TMPro gameobject is activated here animation plays with the default meterial on the TMPro gameobject.

    if I keep the the TMPro gameobject active(not suitable for the game) the animation plays as expected
    if keep it active during the setup then setActive(false) same issue
    before upgrade 2019.4.21 the animation played correctly.
    Can anyone point me to where the issue/error is. I posted on answers site also https://answers.unity.com/questions/1827192/textmeshpro-meterial-reverts-to-preefab-default-af.html
     
unityunity