Search Unity

Is Timeline the solution?

Discussion in 'Timeline' started by hiab-x, Dec 1, 2021.

  1. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Hi,
    I've nearly reached the end of making a four scene VR experience. I say 'experience' because, once you've pressed start, it's just an immersive four scene story with an audio track telling you what's going on.
    The scenes are all made, but now I need to chain them together so that when scene one audio ends, scene two begins, when scene two audio ends, scene three begins...etc.

    Q1: Can Timeline be used to implement this desired outcome or do I need to do something else?
    Q2: The scenes aren't massive, but It would be handy to begin loading the next scene while the current scene is running. I assume that this can be done to prevent delay between scenes?

    I know that the answers might require some in-depth explanation, so If anyone can suggest a good tutorial video which explains some of the above methods, I'd be more than happy with that. Hope you can help. Thanks

    (Project made using 2020.3.18f1 + HDRP+ Unity XR Interaction/management package)
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    I'm unsure what the use-case is here. You say the scenes are ready, so presumably everything is animated etc? What do you want to use Timeline for? To check when the audio ends? It seems overkill for that.

    Maybe I'm misunderstanding something, please ellaborate.
    Look into : https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html but if I recall correctly, it's not trivial to start loading earlier and not cause any hitching. Maybe someone that has actually implemented this will chime in, I personally have given up on using any async Unity methods.
     
  3. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Hi, thanks for taking the time. Timeline is only to be used in scenes 1 (and possibly) 4, as there's some simple storytelling animation. Scenes 2 and 3 are pretty much 3Dof camera rigs with some non-timeline animations already established. I just haven't been certain how to create a scene which purely runs in length to the audio track, then skips ahead to the next scene when the audio has served its purpose. By the sound of what you've said, I'm starting to think that it sounds like a C# script would be the requirement.

    The problem with being a 10 week old development noob, is knowing how to describe the problem in order to find an appropriate solution. If the whole thing is scriptable, do you know the steps I should take? I also have used Bolt a little for transform.rotate scripting, so open to suggested nodes which might take the pain out of watching someone on Youtube type a script, which I then have to pause to copy out parrot style. Yes, I'm a total C# donkey.

    If you advise against trying to preload the next scene, i'll take that as a suitable warning and leave it. My deadline is on Saturday, so just getting all 4 scenes to hang together and run in sequence is all I'm looking for at this stage.

    thanks again. :)
     
  4. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I don't do game development, so use this advice at own risk! But my thoughts were along lines of whether Timeline offers strict control over positions etc, or if interactive can the length of things change. For example, you could use Timeline to control movement of a target object that characters move towards. Based on interactive inputs (or random number generators etc) you can change what happens a bit (e.g. a character stops and talks for longer before walking towards target again). If the end time varies, then Timeline seems more risky to decide when to move to next scene. If fixed known duration, then it "feels" safe to me. You can do things like emit signals when a Timeline finishes for example. (But I will be up front and say I have never used it that way - I don't write games - I just use it to render video clips as an authoring tool, then share the output video file.)
     
  5. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Hi Akent99, thanks for your thoughts. The scenes are mainly just using XR rig cameras, locked into a 3Dof location, the first scene will benefit from timeline as objects appear, move, disappear and the time of day changes depending on where we are in that animation. Other than that, the experience is more of a rollercoaster ride through some psychedelic scenes I've made. Because the project is divided into a small number of scenes, rather than one big scene, I'm still unclear how to set up the necessary jump from scene to scene. I'd like it to be automatic based on what I assume will be some form of C# script to know that the audio from one scene has finished, therefore the next scene needs to be loaded. Because I'm very new to this, I have no idea what to start digging into in order to get that functionality going.The visuals and audio work well together, but the audio; spoken word narrative, is the key component to start and end any given scene.
     
  6. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Not sure how big you scenes are, no idea of performance, no idea how much memory required! With those disclaimers out of the way, the new Unity "Sequences" support includes a "Scene activation track" where your main "scene" (with all the characters and things you animate) can load and activate other scenes scene (typically the background setting). You can have one timeline then daisy chain other timelines, flipping to different scenes. But never tried it in your sort of application and its relatively new. So given deadlines, not sure how experimental you want to go! https://docs.unity3d.com/Packages/com.unity.sequences@1.0/manual/timeline-window.html
     
  7. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Hello again, thanks for the continued help. Yes, it would help to see something to give an idea of the scenes. I've attached a file. Top left: Home screen, small rural scene, rotating object and start button. Top right: Scene 1 small rural campsite scene, timeline minor animations. XR Rig outside a tent, no player control beyond head movement. Middle Right: Tunnel with spinning object at the end. XR Rig in the middle. Textures on the tunnel move towards the player, particle effects move towards the player, when audio ends jump to Bottom Left: Money shot scene: LOD Based structure set to static batching, Fixed XR rig within this scene. Some particle effects. Audio ends, scene jumps to variation of first scene, now at night. XR rig outside of tent, particles make campfire flames, fade to black then credits. Return to Home screen.

    It had crossed my mind that I could use the timeline to make a hidden trigger/activator to jump scene, then just dump it as an invisible animation on the player at the precise point when the audio ends, rather than needing to go to the trigger, the trigger just comes to you. I don't know really, I'll try it later and see what happens. I appreciate the link, just about to look into it. I'm sure the problem isn't insurmountable, after all, this software is designed to create experiences with multiple scenes and there's probably a simple method for making storytelling a straight-forward process. I'd originally assumed that Timeline would have the answer as it seemed the most logical way to program a sequence of events in a linear way, so that when the sequence ends, something like 'load next scene' could be the final frame of that process. It would be a crappy conclusion to have audio which plays out with a 'then this happened' and nothing happens because you can't dump in a scene jump command.
     

    Attached Files:

  8. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    PS: The link you've posted looks very promising.
     
  9. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    PS: The artwork you shared is very cool looking!
     
  10. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Thanks. Although I'm midway through building the web site, some of the project is covered here www.psychehedron.com In the meantime, feel free to leaf through, I'm just going slowly insane trying to write an essay, finish a project, build a web site and a whole bunch of other things all to be done and dusted this month. Aiiieee
     
  11. hiab-x

    hiab-x

    Joined:
    Apr 14, 2013
    Posts:
    34
    Update: In the end, I found this tutorial and it resolved the issue.

    Really simple script, beautiful public inspector implementation, just state the scene duration in seconds, transitions naturally follow.