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.

Animation event function

Discussion in 'Visual Scripting' started by Cyrus-lam, Aug 3, 2021.

  1. Cyrus-lam

    Cyrus-lam

    Joined:
    Mar 1, 2016
    Posts:
    6
    Hello all, I have a question about the animation event something like below:
    - I have a attack animation from frame 0-100
    - Added a animation event at frame 50 and named " AttackEnd"
    - it have a script machine and have a graph call "AnimEventGraph" at the same gameobject
    - inside i have a "Named animation Event" node to Listen to the "AttackEnd"

    so currently it have an error:
    'Character_Rig' AnimationEvent 'AttackEnd' on animation 'AttackClip' has no receiver! Are you missing a component?

    I'm wonder how can the scrip listen to the animation event.

    many thanks
     
  2. boy-ish

    boy-ish

    Joined:
    Feb 24, 2022
    Posts:
    1
    I'm having the same problem, I feel it may be an issue with the visual scripting as I can get it working with a regular script.
     
  3. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    I personally use TriggerUnityEvent Animation triggers. only because it seems to work.
    not sure about the limitations or whatever on unity events compared to custom events etc.

    here's an example of the Trigger I'm currently using to spawn spent shells using my own object pool thing
    Capture.PNG Capture2.PNG Capture3.PNG

    would be interesting to make an animation with tons of triggers and see how/if she works.
    could just trigger a sequence of time based events with the animator without actually animating any object