Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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