Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Event system for Mecanim

Discussion in 'Assets and Asset Store' started by G1NurX, Dec 25, 2012.

  1. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Thanks Gin, definitely works!
     
  2. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,342
    I noticed that Unity 4.3 already supports mecanim events. I'm wondering what the difference between this package and the event system that's in Unity 4.3 ?

    Cheers.
     
  3. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    While it's nice they integrated the Events into each anim clip, there isn't much more to it. I got it to work immediately as it functions just like Gin's plugin here, where the name of the event is the function you call in your code, but it didn't behave predictably. I placed events on only two of my many animations, just to test it out, and the events would fire even when the animation wasn't playing. It did play ONLY in the state the two sequences were in, but they were otherwise not being playing nor blended with.

    The other problem I heard was precision; Gin's plugin is far more precise and will always fire events whereas Unity's (and this is just what I was told) fired 1 out of every 3 times. Take that for what its worth but I suggest you test it yourself.

    Otherwise rest assure I'm still using Gin's plugin and not Unity's version.

    Cheers
     
  4. TheAdam

    TheAdam

    Joined:
    Jul 2, 2013
    Posts:
    4
    yeah I also prefer the plugin to the native functionality, because the plugin has:
    • specific time tweaking - if I have an event that I know an animator wants fired off right at the half point, with the plugin I can just write 0.5 in the time slot. With unity, I have to drag the scrubber very very carefully.
    • mark critical - sometimes unity just doesn't fire events. I could understand this for performance reasons, but it's too much - I had a unit walk 30 steps, and 10 of them didn't call my function to play the footstep sound. When he's front and center and there's not much other noise happening, that's too jarring.
    • broadcast upwards - with unity, I had to write an event forwarder, because the events can only call functions on components of the object they're attached to. G1N's plugin has the option to search up the hierarchy.
    • use controller's state rather than animation - With unity, if I re-use an animation and want different events to fire, then I'll have to make a completely new copy if I want different events.
     
  5. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    There you go...Adam has more in-depth info that's a fair bet more crucial than my modest concerns haha.

    Thanks man!

    -Steve
     
  6. tmcsweeney

    tmcsweeney

    Joined:
    May 24, 2011
    Posts:
    20
    I'm also seeing the bug where critical events sometime fire twice. It seems to occur when a critical event is very near the end of an animation (normalisedTime=0.999) they play normally, then get caught up again in the sweep for critical events that takes place at the end of an animation, but there is no filtering for duplicates taking place.
     
  7. botroidal

    botroidal

    Joined:
    Oct 10, 2012
    Posts:
    16
    Hi all,

    Its possible make a combo attack system with this addon??

    Regards.
     
  8. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Yes, of course.
    My first purpose of making this addon is to implement my combo attack system.
     
  9. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Hey G1N, I was wondering how development is going on... Any new features we might look forward to? :)
     
  10. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Is this asset still being maintained? G1N has been offline for 4 weeks... :(
     
  11. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    I'm here.Bug will be fixed if being reported. My time is occupied recently :(
     
  12. Nims

    Nims

    Joined:
    Nov 11, 2013
    Posts:
    86
    I wish this system had curves built into it similar to those used by mecanim?
    Is this something you are planning on in the future? Can i make this a feature request?
     
  13. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Sorry, I don't understand the purpose of the existence of the curve.
    What are you willing to do with the curve?

    Could you describe your situation so I can catch your idea?:)
     
  14. Nims

    Nims

    Joined:
    Nov 11, 2013
    Posts:
    86
    Sure :D
    The advantage of your system is that it isn't tied to a clip.
    But lets say we have an animation for which we need to change the collider size of the animated object according to the animation.
    Having a similar system to the curves implemented into mechanim (which is tied to a clip unlike your system) would solve me a lot of problems...as i wouldn't have to try to embed animation into the character model (Via 3rd party software like motionbuilder for example) in order to apply the curves function to an animation using the standard mechanim curves.
     
    Last edited: Feb 11, 2014
  15. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Hi Gin, I was wondering how the colored tick marks implementation is going. Or if you eventually decided not to do it...
     
  16. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    $colortag.jpg


    I will upload a patch at the weekend.
     
  17. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Sorry Nims.
    I think it should be the job of another tool.
    This event system is originally designed for dispatching dispersed events.
     
  18. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
  19. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Fantastic! Thank you Gin! :)

    Now I feel a bit silly for asking, but how exactly do I use this patch file...?
     
  20. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    This's a git patch. If you have no idea about how to apply it just send me an email with your invoice number, I'll deliver you a ready-to-go archive.
     
  21. theHost

    theHost

    Joined:
    Nov 30, 2009
    Posts:
    37
    I have the latest version of this plugin, but I am not always getting the animation event even if I mark it critical. These problematic events are usually near the end of the animation. Any ideas why?
     
  22. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Is the former one a loop state?
     
  23. theHost

    theHost

    Joined:
    Nov 30, 2009
    Posts:
    37
    I have 2 animations with events (one looped, other stays in state at end), and both have these issues.
     
  24. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Hi,
    If not extremely long blend time was configured, I have no idea why it was happened.
    In order to help you , I suppose you could provide me a simple/lite environment with problem so I can figure out what's going on.
     
  25. apomarinov1

    apomarinov1

    Joined:
    Oct 21, 2012
    Posts:
    66
    Hey, G1nurX congrats on your work.
    Today I used it to implement footstep sounds for my character that uses blendtrees with walking and running in 8 direcitons.
    What I've missed in Unity`s event system and in yours is the conditions should have EqualsTo option alon with GreaterThan and LessThan. Or at least a RangeOf that would measure the absolute value of a parameter, so for example I have speed and direction wich go from -5 to 5, so I use two conditions - GreaterThan -0.1 and LessThan 0.1, if there was a RangeOf options it would be RangeOf 0.1. So is the equality a deeper problem or really just haven't been implemented?
     
  26. thormond

    thormond

    Joined:
    May 11, 2013
    Posts:
    33
    I'm experiencing the same thing quite often, the thing is when FPS is low you can transfer to another state without triggering the event (if transition is based on Exit Time rather than some flag that given event is setting up), also if animation is fast you are sometimes forced to put it in the middle of the timeline so it triggers consistently
     
  27. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Hi there,
    Test equality between float values is not reliable. That's why I didn't implement it.
    RangeOf is an option but depends on your need whether make it open interval, close interval or half-open interval.
    It's easy to implement new condition by yourself according to your need since you have access to source code.

    Regards,
    G1NurX
     
  28. apomarinov1

    apomarinov1

    Joined:
    Oct 21, 2012
    Posts:
    66
    Hey thanks for the answer. It really got out of my head that I can change the code. I ought to give it a try sometime :)
     
  29. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    118
    Hi, It seems that animation event popup window doesn't work on Unity 4.5 - here's errors i'm getting:
     
  30. TheAdam

    TheAdam

    Joined:
    Jul 2, 2013
    Posts:
    4
    Mine works. Does that happen for you in an otherwise empty project?
     
  31. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    118
    Yep
     
  32. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    118
    The problem seems to be this line in method InitType
    realType seems to be null, and then it's called below:
    when it's called from new MecanimEventEditorPopup:
    Basically, conditionList is null. Any help? I can't add or modify any events because of this...
     
    Last edited: May 29, 2014
  33. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Hi,
    Sorry for the delayed reply. I'm uploading the Unity 4.5 compatible version to asset-store.
    But it takes a few days to be reviewed by Unity.

    People can't wait to get the latest version should send me an email with your invoice number.
    I will reply the most recent version in reviewing.

    Otherwise, download it after asset store updated ;-)

     
  34. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Hi Gin, I just updated to the version that's compatible with Unity 4.5 and I had a very bad surprise: ALL my colored time markers (and their buttons) are back to gray. The color coding is completely gone and there is no way to set color on the tick marks anymore (in the edit popup window). That's a big problem.

    Am I going to be able to get back my color coding or is it all lost work? I really don't understand what happened here and I would appreciate your help on the matter, please. Thank you.
     
    Last edited: Jun 6, 2014
  35. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    820
    The asset store says it requires Unity 4.6.0. Is that a typo?
     
  36. mvesich

    mvesich

    Joined:
    Jan 5, 2013
    Posts:
    5
    Just got to the point in my app development where I absolutely need a Mecanim event system and this looks to be it. Hoping to see a response to schmosef's question that the Unity Asset Store shows Unity 4.6.0 is required. I'm up to date and only at 4.5.0f6.

    Not having access to product docs for early review, I'm curious as how my need fits into the various uses I've read here. I have a bunch of animations for a user to select. When one is played through completion (think of watching a short clip from a DVR) I want an event when the animation is complete. I don't care what the play speed is, I don't care that blending is going on. Simply, at the end of an animation, I need a notification. Is the event system able to address this or need to muck with manually querying the state from Mecanim?

    THX!
     
  37. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    I'm sorry. That's my mistake to upload asset in the beta version Unity.
    Unity4.6 is not available yet. Plugin is 4.5, also 4.6, compatible.
    Anybody failed to download latest version can mail me with invoice.
     
  38. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Before upgrade to new version. Import the new plugin into an empty project. Call your programmer friend to apply the color tag patch. Copy back to your project at last.

     
  39. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Yeah, please make an adjustment the required version back to 4.5. Since the asset shows 4.6 is required you can't even buy it in the asset store because the purchase button is removed if you don't have the right version.

     
  40. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,393
    the author could have made a mistake, which he needs to fix

    or the author didn't make a mistake and 4.6.0 is real close to being released, joy!
     
  41. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    820
    My guess is that it will be released during Unite next month.
     
  42. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    67
    Hi everyone,
    I re-submitted the content to be 4.5 required, but need a few days to be reviewed by Unity.
    Be patient.
    Thank you all.
     
  43. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    413
    I'm confused. I tried to buy this on the Asset Store but it says requires Unity 4.5.2.
    4.5.2 is not out yet. Why would this product require a version of Unity that is not out yet?

    Allan
     
  44. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    820
    4.5.2 has been out for almost a month.

    I downloaded it on July 10.

    Maybe you are using the update check built into the editor. That's never worked me.

    I always download it from Unity directly: http://unity3d.com/unity/download
     
  45. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,342
    Can Event System For Mecanim be integrated with AI for Mecanim and Behavior Designer.
     
  46. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    72
    The primary difference I've found is that Unity's built-in Mecanim events are badly broken in certain circumstances.

    If you've ever made a 2D game with blend trees and Unity's own event system, you notice that events play even on animations that aren't currently running; especially for locomotion it becomes a cacophony of unwanted footstep noises playing uncontrollably.

    I've tried everything I can in order to report this as a bug but I don't think anyone is interested in fixing it.
     
  47. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Hey Gin, I'm sorry but I don't understand what you mean by that. I'm afraid it's probably too late anyway; do you mean the colored keys are NOT part of your asset by default by now?

    I also noticed a VERY BIG bug: if you change the name of a state then all the events for that state are gone! I don't understand how this is possible but it looks like the event system simply loses the connection with a state if that state is renamed. Could you please have a look into that? Thanks...
     
  48. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    G1NurX, will you be updating this asset for Unity 5? It doesn't compile under the U5 beta.
     
  49. Aohajin

    Aohajin

    Joined:
    Sep 18, 2014
    Posts:
    10
    need unity5 supporting
     
  50. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Abandonware. :(
     
unityunity