Search Unity

Question: How can I add an animation event AFTER the end of an animation?

Discussion in 'Animation' started by jleven22, Jul 30, 2019.

  1. jleven22

    jleven22

    Joined:
    Mar 26, 2019
    Posts:
    421
    In my specific circumstance I need to add an animation to the end of an event, AFTER it stops playing/ animating. In other words, I need to add the animation event to the end but not ON the last keyframe, but AFTER it. Right now any events I place after the last keyframe get ignored.

    Any tips?
     
  2. jleven22

    jleven22

    Joined:
    Mar 26, 2019
    Posts:
    421
    Ok so it turns out this is not the issue. The issue is as follows.

    My player's weapon (the child) is located in the scene in a random spot. Shouldn't matter right? As long as I have it located in the right transform.position during parent animations, it doesn't appear otherwise.

    However, in the animation events it disables correctly, but then when enabling at the end of this specific animation, for a single frame the weapon appears in that "random" spot where it is located in the scene (in relation to the parent). That's why it looks like it's jumping. Then after that frame it plays as expected.

    So my first thought is that I just need to have the weapon disabled at all times unless part of an animation. It's a little risky because I don't like enabling through every animation - just seems backwards.

    Any suggestions?