Search Unity

Animation Events don't save?

Discussion in 'Editor & General Support' started by thomasmahler, Oct 27, 2015.

  1. thomasmahler

    thomasmahler

    Joined:
    Mar 18, 2009
    Posts:
    181
    Hey guys,

    I'm running into a bit of an issue here and I think I found a nasty bug in Unity.

    I have a player character with anmations set up through Mecanim -> When the player attacks, I set up an animation event to call a function that plays a SoundEffect.

    That all works beautifully, but if I apply the prefab, save the scene, exit Unity and reload the scene, the animation events are completely gone.

    This happens in Unity 5.2.2f1. Can anyone confirm that this is a bug or am I doing something wrong?
     
  2. thomasmahler

    thomasmahler

    Joined:
    Mar 18, 2009
    Posts:
    181
    Whoa, we just found out the issue. For some reason, the animation itself was set to Read-Only inside of Unity, which is why the animation events weren't stored.

    Hey Unity Devs, it might be nice to throw a WARNING into peoples faces that says something like: "You can't change this asset since it's set to Read-Only!" -> Otherwise people might spend hours upon hours setting up events, restart Unity and boom, everything's gone.