Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can we use the Timeline to create a little story triggered by user interaction?

Discussion in 'Timeline' started by Galbert-IT, Mar 29, 2020.

  1. Galbert-IT

    Galbert-IT

    Joined:
    Mar 8, 2020
    Posts:
    7
    Hello everybody,
    First of all, greatest kudos to the team of Unity developers: you really created a huge piece of software guys!
    I'm a developer as well and I can appreciate the great coding work that is behind the Unity engine.

    Compliments apart, I have a question for you.
    I'd like to create a little story that evolves depending on user interaction. Substantially, at the beginning a Timeline starts and a character in the scene says a couple of phrases, then it should pause waiting for something to happen (e.g. the Player walking farther than a given distance, clicking on some buttons etc...) and then start again from the third phrase, and so on.
    How is it possible to do this? I have some horrible workaround in mind that would probably work, but I hope that the Signals and/or the Marker + Notification technology can do this in a more elegant way!
    For instance: set a Marker/Signal any time the story is supposed to come into a "waiting" state, and link this to a Receiver (or something that receives a Marker Notification) that pauses the Playable Director timeline (I already checked it can de paused and played on demand). Then, on some Update event, if a certain trigger has been marked (and some others not), resume the playback at a given time (jumps may be possible if needed).

    Do you think this may work? Do you have any suggestion in this regard? Would the Signals or the Marker + Notification system be more appropriate for this to work simply and effectively?

    I attach a couple of screenshot with my nice bot-guide that should accompany the player during the VR experience.

    Thank you in advance,
    Fabio de Nicolo from Milan (Italy)

    The Timeline I started to create
    Timeline.PNG

    The beginning scene Scene.PNG
     
  2. Soliujamiu02

    Soliujamiu02

    Joined:
    Apr 5, 2020
    Posts:
    2
    You can check bizideas4beginners.com for something similar like that
     
  3. Soliujamiu02

    Soliujamiu02

    Joined:
    Apr 5, 2020
    Posts:
    2
    You can check bizideas4beginners.com for something similar like that
     
  4. Galbert-IT

    Galbert-IT

    Joined:
    Mar 8, 2020
    Posts:
    7
    Hi, meanwhile I managed to get it working by some signals and the corresponding receiver!
    It's great! =D
     
  5. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    hey man, i have the same issue here , i want to activate ascene during the game and then get back to the game another on in a certain area, how did you manage that
     
  6. Galbert-IT

    Galbert-IT

    Joined:
    Mar 8, 2020
    Posts:
    7
    Hi Muhamad, I'm a sort of newbie in the world of Unity but I will try to share my thoughts anyway.
    I suggest you to look on YouTube for conferences held by the great "technical evangelist" Ciro Continisio, who explains the strategy very well, for instance here:

    The main ingredients are:
    1) A signal emitter on a timeline, that (as the name suggests) sends a "signal" on a given channel (I don't know if it's mandatory, but I strongly suggest to create it as an instance of a signal asset you must manually create);
    2) A signal receiver on a certain game object that you linked to that special signal track (this is not the only way to do this, but the most convenient one in my experience);
    3) That receiver must be equipped with a "reaction", i.e. a public void C# procedure hosted on a script (presumably but not necessarily associated to the same object as the signal receiver) that will actually do the job you need (pause the original timeline, start a new one, enable a trigger in the joystick or whatever fits your need).
    Remember that all the "objects" (from a programming point of view) that you need to reference in your script must be public variables that you will associate and link by user interface (at least, that's what is done most often).
    This is maybe not the best strategy, but for me it works fine.

    Kindly
    Fabio
     
    muhamad1987 likes this.
  7. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    Thank you fabio for the answer , i will watch the video and try my best .