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

Mecanim Event Triggered

Discussion in 'Animation' started by avalonuk, Jan 30, 2017.

  1. avalonuk

    avalonuk

    Joined:
    Jan 8, 2017
    Posts:
    20
    Hi All, Just wondered, have been looking but need to know if animation event has been triggered in, anyone had this problem???
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,204
    The animation events gets called on any script attached to the same GameObject as the animator. So you can have a script there that checks when the event gets triggered.

    Or am I not understanding what you need? I think your question is missing a word after "in"?
     
  3. avalonuk

    avalonuk

    Joined:
    Jan 8, 2017
    Posts:
    20
    Hi there, thank you for your reply, yeah I can get the event triggered but the script has to be in the main object component, so its get triggered all the time, I just want it triggered when the animation triggers it... what I mean is the main character is Idle, and I have the script there, but I don't want it triggered till the animation for stopping triggers it...
    Hope that makes sense.... lol
     
  4. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Your events will only get triggered if an animation sends that event (unless you named it Start, Update, or any of the methods that are automatically called every frame on MonoBehaviours, or unless you call the method yourself).

    So if you are receiving the event while in Idle, then it's probably because Idle is sending the event.