Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

How to build an in-game cinematic

Discussion in 'Virtual Production' started by Wyldfire42, Aug 27, 2021.

  1. Wyldfire42

    Wyldfire42

    Joined:
    Aug 7, 2020
    Posts:
    5
    Hello all,

    I've been struggling with how to build an in-game cinematic. I'm trying to make a story-driven game, along the lines of "Life is Strange", "Jenny LeClue", or "AI: The Somnium Files". So, I need to be able to go from player controlled walking around to game-controlled characters and back. That also means that cinematics might pause for a user response and then go down different paths. Or the lines that characters speak may use text boxes that the user can dismiss whenever.

    I've been reading about Timeline and Sequences, and I did the new "Cinematic Studio" sample. And while these all seems like good and useful things, I'm struggling with seeing how to use them for something that isn't strictly a movie.

    While something like a sample project would be nice, I'm really looking for some high-level guidance on how best to build this sort of thing. Sequences and Timeline seem to do a lot of nice things, but unless I'm missing something aren't useful as soon as you need to do something that isn't fixed on a timeline.

    Would something like.... SequenceA -> <Choice> -> SequenceB or SequenceC make any sense for this? It seems like you'd have to redefine so much that it'd be more harm than help. Do any of these tools actually help *game* cinematics or do I need to roll my own solution?
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I have never done it, but I assume you create a game as normal, then use the "Play" method of Playable Director (Timeline is a playable director) to start the sequence playing. You can fire events from timelines, so I assume it can call a method to change state on your game objects at the end of a timeline (so user controls start working again) - but there may be some better approach.

    https://docs.unity3d.com/ScriptReference/Playables.PlayableDirector.Play.html

    But I think the mental model is a game that triggers a timeline sometimes, not a timeline that controls the game. I have certainly seen articles talking about it (but never read them closely sorry).
     
  3. Wyldfire42

    Wyldfire42

    Joined:
    Aug 7, 2020
    Posts:
    5
    Thanks for the response! Somehow in all the research I've been doing I never even came across this "Playables" API, so this certainly sounds like a good avenue for me to explore. Thank you very much for the pointer!
     
    akent99 likes this.
  4. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I'll build a little on what @akent99 wrote.

    Note that Sequences was created specifically to assist animation-/film-makers, so while it might be suitable for games, it's not an area we've tested much. The key tricks that Sequences performs are designed to wire up all the bits of a timeline (the Timeline, the Hierarchy, and the assets in the Project) to make it easier for folks making (mostly) linear content.

    Timeline, though, is definitely designed for both. The Playables API is definitely a good place to focus. Mostly, users who have branching narratives-style games will have some system for managing all their Timelines and will load and play them at appropriate moments, then send a Signal to indicate that they've reached a moment for something else to take over.