Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Issue 'Animation event which attached at frame 0 called twice' still exist?

Discussion in '2D' started by DevGulpi, Aug 12, 2021.

  1. DevGulpi

    DevGulpi

    Joined:
    Aug 6, 2021
    Posts:
    17
    My Unity version is 2020.3.2f.

    I checked these things below

    1. This animation is non-looping.
    2. This animation have only one event at frame 0 which called twice.
    3. This animation is default animation, and don't have transition.
    4. When this animation ended, I destroy gameobject which have this animation controller. Destroy event is attached at last frame of this animation.
    5. I tried to delete event right after event called, but event still called twice.
    6. I don't get user input to play this animation. Just instantiate Prefab which have this animation controller.
    7. This animation have other events too, but only the event at frame 0 called twice. Other events are called once normally.

    I searched about this problem, and found this discussion.
    https://forum.unity.com/threads/mecanim-4-3-animation-event-sent-twice.213830/
    This issue was discussed a long time ago, but I can't know this bug was solved.

    There are other things that I can try more? Or this is just bug?
     
    Last edited: Aug 13, 2021
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Is the object instantiating twice on accident? Is there some way the animation can be triggered via code and maybe its calling in start when the object instantiates as well as the default anim state? Can you share the code of your script where the object gets instantiated?
     
  3. DevGulpi

    DevGulpi

    Joined:
    Aug 6, 2021
    Posts:
    17
    The code contains many other actions so it's bit difficult to share, but I checked the prefab is instantiated once by log. But maybe I can try to change default animation. Thank you.