Search Issue Tracker

Fixed in 5.4.0

Votes

32

Found in

4.5.2f1

Issue ID

624764

Regression

No

Overridden virtual functions cannot be used as Animation events

Animation

-

To Reproduce:

1.Write an overridden virtual function just like Event4() in Arrow.cs and ArrowBase.cs, in the attached project.

2. Create a new event on the ScaleUp animation, which is being played on the Arrow object, notice that 'Event4' which overrides a virtual function cannot be used as an event handler (Event1 & 2 from the same script work fine).

3. It's possible to workaround this by first assigning the function in the event and then changing in to an overridden virtual function (as Event3 in this case) and it seems to work fine.

Repro: 4.3.4f1, 4.5.2p2, 5.0.0a19

Comments (11)

  1. UDN_99df3bc5-2caf-4681-b933-918de8e0ff74

    Aug 05, 2016 07:43

    is it fixed yet??? come on unity...

  2. Denggoon

    Nov 13, 2015 03:13

    STILL HASN'T FIXED THIS YET!?!?! C'MON UNITY........ WHAT A LAME

  3. Peaj

    Nov 12, 2015 13:32

    Ok I was wrong. Does not work because the base type method will be called instead of the derived one.

  4. Peaj

    Nov 12, 2015 10:19

    Overriding did not work for me (in UI Events). Even the overriden methods wont show up.
    I found a workaround to have a non virtual method in the base class that calls the virtual method.
    Its just som kind of wrapper and you can forget about it in the derived types.

  5. MiguelJD23

    Jul 07, 2015 15:09

    I'll be trying this workaround because it's REALLY annoying to break all the OO we had so much work on doing T_T

  6. Thromshall

    Jun 30, 2015 01:44

    Just ran into this one... super annoying. Please fix asap.

  7. Trungdv

    Jun 16, 2015 16:14

    This bug is really really annoying. Hope they will fix it soon.

  8. rndrobin

    Jun 10, 2015 19:13

    We just rewrite the functions in the derived classes and reuse the base functions.

    Base class:
    public virtual void DoAnimationEvent()
    {
    }

    Derived class:
    public override void DoAnimationEvent()
    {
    base.DoAnimationEvent();
    }

  9. Sarseth

    May 12, 2015 20:21

    How long can we wait for such a simple issue?

  10. phasiclabs

    Apr 23, 2015 16:02

    Another workaround is to use another function that can be selected, then modify the anim file in a text editor to use the correct function (assuming you serialize assets as text).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.