Search Unity

Animation Editor (Function not supported)

Discussion in 'Editor & General Support' started by Sam55555, Nov 25, 2009.

  1. Sam55555

    Sam55555

    Joined:
    Jun 26, 2009
    Posts:
    17
    Hallo,
    I want use new Animation Editor,but i have follow message by Animation Events: "Function Not Supported".Any idea how can i solve this problem?
     

    Attached Files:

  2. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Hi

    Have you tried adding some log message in to see if the events are actually getting called.

    Code (csharp):
    1. Debug.Log("Called from animation");
    I had a similar error where it said the function was not supported, but seemed to call it just fine regardless.

    Cheers
     
  3. Sam55555

    Sam55555

    Joined:
    Jun 26, 2009
    Posts:
    17
    Yes,i have message and it print this message sometime.The function execute sometime too.The event is in last frame and animation play once.Maybe sometime last frame ignore.
     
  4. yosh

    yosh

    Joined:
    Mar 13, 2009
    Posts:
    142
    Hi,
    i have the same problem.
    Where does the script-function has to be placed or is it regardless and i can define a function which is not a component of the selected gameobject with its animations?

    I get no prints or Debug.Logs, so i wonder what i have to get this thing run...

    Thanks
     
  5. cannon

    cannon

    Joined:
    Jun 5, 2009
    Posts:
    751
    The function gets called on any component attached to the same game object the animation component is attached to.

    If the function is not implemented, then I guess it means that no component exists that can catch the named function. Normally you can only create an event that calls a function that already exists, but the connection can be lost if you move animations or attach/detach components.

    It works similar to a SendMessage.
     
  6. yosh

    yosh

    Joined:
    Mar 13, 2009
    Posts:
    142
    Thanks for your reply.
    I supposed to that so i added a new script to that gameobject. In that script is my testfunction with print-output. But it doesn´t work.
    Any ideas?
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    could you provide the script that you use on the said game object?

    I used the animation editor to create a few camera fly through with timed actions and didn't have any problems.

    The function I used were defined as

    Code (csharp):
    1. public void MyFunctionThatDoesSomething() {
    2. ...
    3. }
    in a MonoBehaviour extended class

    A JS counterpart would be

    Code (csharp):
    1. function MyFunctionThatDoesSomething() {
    2. ...
    3. }
    just in about any js file as js declarations are public by default and void can be omited as return type
     
  8. cannon

    cannon

    Joined:
    Jun 5, 2009
    Posts:
    751
    If you enter the functions dreamora put, you should see the function name appear in the dropdown when you add a new animation event.

    If the function does appear in the dropdown, then the only reason I can think of is that your animation is playing while outside the camera frustum, and "Animate only if visible" is true.
     
  9. yosh

    yosh

    Joined:
    Mar 13, 2009
    Posts:
    142
    I attached a screenshot which shows the "Test"-Component with the following function:

    Code (csharp):
    1. function printout (value : float) {
    2.     print("value: " + value);
    3. }
    Thanks for your help.
    Nice to have such an active community.
     

    Attached Files:

  10. yosh

    yosh

    Joined:
    Mar 13, 2009
    Posts:
    142
    Mhh, i started the gamemode with this example i mentioned and although the message "..function not supported" is shown, the print output is now correct. Also with parameters and it works if the "Test"-Component is not enabled, too. Strange...
     
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    thats not strange, thats expected.
    enabled only impacts start and the "onXY" automatic callbacks not the rest that works through the message / invoke paths.

    animationevents actually are SendMessage as mentioned above and in the script reference :)
     
  12. Hilmer

    Hilmer

    Joined:
    Mar 15, 2010
    Posts:
    6
    I have a problem when I have two different scripts attached to the gameobject. Only functions in the first (first to be added to the gameobject) script can be called from Animation Event. Functions in the second script are flagged as "Function not supported".
     
    CarterG81 likes this.
  13. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    That is a limitation of the animation editor currently. You could request multiple scripts as a feature (menu: Help > Report A Problem).
     
  14. RalphFW

    RalphFW

    Joined:
    May 7, 2011
    Posts:
    18
    Is this going to get fixed any time soon? I've just run into this bug and it's kind of ridiculous. There's no way to re-order the scripts in the inspector so I have to remove all the scripts and then re-add the one with the functions I want first. Absurd.
     
  15. DDowell

    DDowell

    Joined:
    Feb 8, 2012
    Posts:
    52
    This is a very annoying limitation. Of course it should be all scripts attached to the game object. I concur with all previous posters.
     
  16. Mloren

    Mloren

    Joined:
    Aug 20, 2011
    Posts:
    83
    This appears to only be a bug in the displayed "function not supported" message.
    I tested it and functions can be triggered by events on multiple scripts even though it displays the message saying it cant.
     
  17. gaojinjing

    gaojinjing

    Joined:
    Jun 28, 2012
    Posts:
    10
    I know litter ,events can't in last frame and animation play onec
    !remeber!
     
  18. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I just got burnt by this one on Windows 8.1. This needs a big red error message to be spammed to the console when you make a build to a platform that's effected by it.

    Edit:

    Ok, false alarm, it was something else that was making it not work... but I don't understand why I get this message if it actually does work now...
     
    Last edited: Dec 21, 2013
  19. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    No. Absolutely not.

    It is 2015, and you still have to make the first script the one which holds ALL animation events. Beyond ridiculous.... 5 years a problem.

    Does Unity fix ANY of their features, or do they just add new ones instead. Bleh.
     
  20. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    I would submit a bug with a repro if it's not working with scripts not at the top.

    It says (Function not Supported), but it still works (I'm looking at an example right now).

    Could do with an update after all this time however, I'd agree.
     
    CarterG81 likes this.
  21. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,660
    CarterG81 likes this.
  22. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    Awesome. And it only took over 5 years!
     
  23. TheWarper

    TheWarper

    Joined:
    Nov 3, 2013
    Posts:
    112
    So, I was getting the same message, "Function Not Supported" when hovering over the Animation Event in the Animation Timeline. Basically, this isn't indicative of reality, (it is supported).

    The problem was the Animation Event on frame 0. I moved it back to frame 1 and it properly calls the function now. :)

    Edit 4-13-2015: Last I checked (Unity 5.0.1), it's fine being on frame 0
     
    Last edited: Apr 14, 2015
  24. amiel_ace

    amiel_ace

    Joined:
    Oct 25, 2014
    Posts:
    18
    Bump! Please fix this thing. :D
    It's Saturday April 4 2015 today
     
  25. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    This needs fixing...
     
  26. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    If it needs fixing, do a proper bug report with a small example project and post the case number here.
     
  27. amiel_ace

    amiel_ace

    Joined:
    Oct 25, 2014
    Posts:
    18
    This was fixed! Thank you!:cool: