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 Trying to figure out issues with changing variables through keyframes

Discussion in 'Animation' started by NetplayTactics, Nov 1, 2022.

  1. NetplayTactics


    Jan 8, 2021
    The idea of being able to edit components and values through keyframes is neat; the issue I'm having is that I can only turn scripts on or off, or enable components/objects. Sort of. Now that I think about it when I was setting up my double-tap-to-dash I didn't set up its own script yet, so when it modified the character's speed it didn't have any effects elsewhere.

    The specific issue:
    When I have the character do a special attack it checks for a value to tell if it should do the attack or not. I tried "resetting" the value to 0 instead (shown below) of tying it to code to see if I can get away with doing it this way, and my results are strange. If I do the series of inputs needed to trigger the attack it refuses to play the attack... until I hit a different button, then if I press the original button it plays the animation...

    Edit: Forgot to mention that to me it looks like the properties on that animation are reaching outside of the animation. This didn't happen with speed as noted above, but if I'm trying to set the value that triggers an animation the animation's settings override whatever should be happening code-wise regardless of if the animation is playing.


    I'm going to just tie the value's resetting to the input timer, but I'd really like to know what's going wrong since I really like using keyframes to do things.
    Last edited: Nov 1, 2022