Search Unity

Question Controller forgets its variables upon deactivation => reactivation

Discussion in 'Animation' started by Were_Elf, Apr 13, 2022.

  1. Were_Elf

    Were_Elf

    Joined:
    Feb 25, 2022
    Posts:
    53
    I have an animation controller with 2 versions of one animation. I'm using a trigger to play the animation, and a bool to determine which version to play. I meant this bool to be a "set and forget" thing - I set it to true when the ability is upgraded. However, when I deactivate the hero, and reactivate it (between different rounds/after death) - the bool is automatically set to false.
    Is there a way to remember it, or do I need to manually set it every time I reactivate the hero object?
    Note: For now I am setting it up every time I reactivate the object, but I am generally curious if there is a way for the controller to remember the bool by itself.
     
    Last edited: Apr 13, 2022