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. Dismiss Notice

Timeline events?

Discussion in 'Timeline' started by BeautifulFish, Jun 24, 2017.

  1. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    739
    I may be nothing ;)

    Again, thank you!!! The realisations your plugin gave me, and your way of explaining and showing things, were truly invaluable. THANK YOU!!!!
     
  2. tarahugger

    tarahugger

    Joined:
    Jul 18, 2014
    Posts:
    129
    Here's my contribution to the cause - a port of the conditions UI from Mecanim into the timeline.
    • The track binds to an animator and uses that to populate all the current Parameters.
    • Each clip can bind to an object to receive events via ExecuteEvents/Interface.
    https://github.com/imxzjv/UnityTimelineConditions



    EDIT link to non-bad-quality video
    Code (CSharp):
    1. https://streamable.com/srxk8
     
    Flurgle, zIyaGtVm and Deeeds like this.
  3. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    @seant_unity

    These are really great solutions so far, but is there any word on native Timeline Events yet? -- It is 2018.2.3 now and I've still not heard a peep from you guys about this...

    I know it's not 2018.3 quite yet (and according to your post here, it's probably still coming), but I just wanted to be sure since it seems like other "lesser" features suddenly disappear from existence too -- and with no word from anyone @Unity about their disappearance either.

    Are Timeline Events still headed our way, or has there just been some delay...?
     
    Last edited: Aug 15, 2018
    Deeeds likes this.
  4. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    174
    Timeline Events are being worked on as we speak. The feature has been delayed but it is now pretty far along and we are targeting 2019.1. Stay tuned.
     
    Elecman and hwaet like this.
  5. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Wow, what a delay indeed!

    Thanks for the response on this though! -- I assume a lot of internal reworking to fit in better with the new ECS "performance-by-default" approach to make it perform better (by default)? -- Or am I waaay off on this?
     
    Deeeds likes this.
  6. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    174
    We strive for both performance and accuracy; events will be sent through the playable graph. And yes, a lot of changes to the Timeline/Playable code was required to make it work.
     
    Lars-Steenhoff likes this.
  7. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Nice! -- That's great to hear events run directly through the graph at such a low-level. I was worried this was one of those features that "missed the bus" to be integrated into the first waves of the new "performance-by-default" paradigm.

    Thanks again for the clarification on this! -- It's always great to hear when systems that can work together are actually being redesigned to do so! :)
     
  8. Deleted User

    Deleted User

    Guest

    Hello people!

    I came here to look for an answer or a workaround for events in the timeline, but till I read all posts I found a way. This method/workaround for using events in timeline seems a little bit more clean without a need to write additional scripts for Playable, but the functionality that you need to achieve. So let me describe it for you:

    1. Write a public function that should do your functionality in a script.
    2. Select the object you want to hold the Timeline. To be precise it will hold a Playable Director and an animator (you can delete the animator component, it won't be used).
    3. Create a Timeline asset clicking "Create" while the recent gameobject is selected and the Timeline window opened. Name it whatever you want, I prefer calling it just Timeline.
    4. Drag and drop the gameobject you want to trigger the functionality on to the timeline, when the menu appears choose "Add Animation Track". It will create an animation track in the timeline and will add the animator component to that object. Also add the script you recently wrote your functionality.
    5. Open the animation window while the recent gameobject is selected. Click on "Create" to add an animation clip and name it whatever you want (prefer the action it's doing), an animator controller named same as the gameobject is also created.
    6. Click on the created animation clip and uncheck the "Loop Time" property if it's not needed, in Inspector window.
    7. Open the "Animator" window, click on the recently created animator controller in the "Project windows". Inside the animator window click on the animating state (the orange one by default, it's named same as the animation clip) and set the "Speed" to 0. If you leave it set to 1 it will play the animation when you click Play.
    8. In the hierarchy windows again select the gameobject, while the animation window is opened. In the animation window select whatever frame you need to be the trigger on, click on the "Add event button".
    9. In the inspector select the function you need to be triggered.
    10. Let's go back to the timeline where your animation tracks are. On the track section underneath the time section right-click and select "Add From Animation Clip" and choose your animation clip.
    11. The animation clip in the timeline will trigger the event.

    So you can create an event trigger inside the Timeline. This method seems a good one for me, at least I can do the things I need this way. It would of course be a much more efficient way if there is an UI for this, but it's up to someones work to make that happen. I'm just sharing what I could do to make it happen. Sharing is caring :) :) Hope it will help ya'll.
     
    Whatever560 and Deeeds like this.
  9. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    120
    Thank you for sharing this. It's a great implementation of the Event system. You would think Unity could build something like this pretty easily with all of the support they have. Not to mention it's essentially a critical feature for any timeline system.
     
    Deeeds likes this.
  10. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    when is 2019.1? A few people are asking me about my timeline events unity package. Don't want to get them using my system if it's not necessary.
     
  11. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    745
    (obviously in beta before these dates)
    2018.1 was 2nd May
    2017.1 was 10th July

    So, one could assume around the same time next year for 2019.1
     
  12. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    If anyone is interested, Timeline events are going to be included in the next public alpha of Unity 2019.1: 2019.1.0a10.
     
  13. nathanjams

    nathanjams

    Joined:
    Jul 27, 2016
    Posts:
    296
    Woohoo! Thanks for the news. There are many third party solutions for this but an integrated one will be most welcome.
     
  14. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Looks like this thread was heavily "cleaned up". I distinctly remember some unhappy campers in this thread who were not pleased to have to wait till 2018.3... but now they won't even be in a 2018 release? Any technical reason why?

    Also, some useful posts have gone missing here too...
     
  15. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Last edited: Nov 24, 2018
    awesomedata likes this.
  16. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Has anyone heard if Timeline Events will be backported to 2018 .3 or .4 as mentioned by @seant_unity previously?
     
  17. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No, it won't be backported to 2018.3/4. Features or major changes aren't backported, only bug fixes.

    All features are required to be in a version before the first beta. As for the events (a.k.a. signals) feature in the alpha, there are a few minor additions that are still on their way.
     
  18. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Thanks for the clarity, @seant_unity.

    Out of curiosity -- is there a technical reason for this particular decision, or is it just policy?

    We had planned (for quite some time) to stick with 2018.3/4 (for LTS), aiming to have native support for Timeline Events (before starting heavy development in this area because we knew that 2019 would be a very rocky transition with the inclusion of nested prefabs and the universal transition to ECS + jobs system).

    I imagine others here were thinking a similar thing, so I thought I'd ask. We clearly need to better-gauge our future development decisions on Unity's thinking in regard to its "in-development" features, as this is a point of mystery to most smaller developers I've talked to who aren't "in the know" with Unity itself. Some insight into your thinking process would be great. :)
     
  19. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    It is both policy and technical.

    The policy is we don't add features during a beta phase as to not introduce risk of bugs, regressions or instabilities. As we move through beta and get closer to release, the risk tolerance of accepting any change decreases. This is company-wide and it done to give the user the most reliable release possible.

    Specifically for events, it depends on other changes that were introduced or changed in Unity for 2019.1. So backporting would cause a cascade of changes, and introduced the possibility of regressions and bugs beyond just timeline. Events, even if it doesn't seem like it, is actually a pretty substantial change to Timeline.

    That being said we want to close that gap between when we develop features/fixes and when users get them in a stable build. Because of that we also moved timeline to be a built-in package for 2019.1. That will allow us to release experimental/preview builds of Timeline in the future. It gives us more freedom going forward to release things that are in progress. Events would have been perfect for this - a 2018.3 events opt-in package would have been possible, even though it would have been less polished and missing a few features. It would have allowed users to try it, use it in real-world scenarios and give us valuable feedback.
     
    awesomedata likes this.
  20. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    That's fair -- I thought this was the case.

    I've heard other users complaining about how slow things have been over the years, and as such, a so-called "simple feature" such as Timeline events was hard for me to justify its pacing without knowledge of the goals behind the feature.


    That said, regarding future "in development" features, I think modifying the Roadmap might end up only being a "band-aid" to the larger problem of users not always knowing what direction their favorite features might take. Having a better (global) idea of the internal goals (and a clearer idea of potential roadblocks) of specific features might better-help users than an ETA or detailed-description of a "feature" might encompass. The new Input System is a great example of offering a better overview with potential roadblocks.

    Just my two cents though!

    @seant_unity -- Thanks for all your (and the entire Unity Team's) hard work on bringing Unity to modern times. It's really becoming the ultimate engine for realtime creation thanks to you guys, and it's a rewarding feeling to be part of that as a user too. :)
     
    vladala, nathanjams and thierry_unity like this.
  21. eric_delappe

    eric_delappe

    Joined:
    Dec 10, 2015
    Posts:
    26
    Will we be able to pass data through signal emitters? A value can be passed into method arguments via the signal receiver, but this means emitters of the same signal type will always pass the same value.

    Basically I'd like to be able to define some set of variables for each signal, set their values for each emitter in its inspector, then pass these variables to methods in the signal receiver. This way we wouldn't have to create a separate signal/reaction pair for every possible value.
     
    nathanjams and AndrewKaninchen like this.
  22. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    You can, but you will need to add a derived a class from SignalEmitter to add the extra data, and implement a custom receiver that knows how to handle the extra data.
     
  23. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Might it be worth it to give an example of this?

    Seems kind of convoluted, and to expect many users to figure this out without some explanation... D:
     
  24. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    It would definitely be worth it. We are in progress of putting together examples and documentation, as well as a few minor pieces that will trickle in before the first beta goes out.
     
    recursive and awesomedata like this.
  25. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    174
  26. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    120
    Excellent news!
     
  27. progmeer

    progmeer

    Joined:
    Oct 5, 2012
    Posts:
    36
    Outstanding!
     
  28. Mest

    Mest

    Joined:
    Nov 7, 2012
    Posts:
    17
    For people using versions below 2019.1, this may help:

    Put this in a Script and attach it to a Gameobject you activate/ deactivate via Timeline (at least it's something):

    using UnityEngine.Events;

    Code (CSharp):
    1.  
    2.     [SerializeField]
    3.     private UnityEvent onEnable;
    4.     [SerializeField]
    5.     private UnityEvent onDisable;
    6.  
    7.     private void OnEnable() {
    8.          CallEvent(true);
    9.     }
    10.  
    11.     private void OnDisable() {
    12.          CallEvent(false);
    13.     }
    14.  
    15.     public void CallEvent(bool _event) {
    16.         if (_event) {
    17.             onEnable.Invoke();
    18.         } else {
    19.             onDisable.Invoke();
    20.         }
    21.     }
    You can actually create a List<UnityEvent> and handle an increment every Enable/Disable, so you have one Object, not thousands...

    -> the only thing, you cant see it in the preview (only if you put more affort in it)
    hope i could help
     
    Last edited: Mar 16, 2019
  29. Flag74

    Flag74

    Joined:
    May 31, 2017
    Posts:
    128
    Hi guys,
    some months ago I started my own Timeline events system for a commercial project I was working on.
    Since it was the heart of the game I decided to make it solid and easy to use.
    This system is capable of invoking custom functions and also passing scene objects to them.
    It's 100% reliable therefore hicups or framerate drops won't prevent events from firing.
    It doesn't use 2019 signals. (compatible with Unity 2017)

    It's not free but maybe you could find it useful :)

    https://assetstore.unity.com/packages/tools/integration/timeline-ez-events-126484
     
    DavidGeoffroy, vamky and seant_unity like this.
  30. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Please tell me this wasn't Timeline Signals... Or was it?

    Are we looking at doing anything with Timeline and DOTS / ECS at some point?