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

Opinions on handling runtime characters

Discussion in 'Timeline' started by CaptainSlow, Jul 17, 2022.

  1. CaptainSlow

    CaptainSlow

    Joined:
    May 13, 2018
    Posts:
    1
    Hi,

    I'm trying to work out the most manageable way to support characters in timelines for use in cutscenes at runtime. Currently my cutscenes are prefabs that I instantiate and play, the prefab contains the various objects required for the cutscene to play out in the world (cameras etc).

    I'm having a bit of a conflict in the two approaches I'm thinking of to nicely handle characters:

    1) Look up characters at runtime and sending them commands like teleport to / move to etc. At edit time I can "preview"/create the cutscene using a transient copy of the character to get a rough idea of how the cutscene plays out at runtime.

    This has the downside of not being able to reference the object as they don't exist inside the prefab but does have the upside of some game features working during cutscenes like the camera system. If no cinemachine camera is active it can fallback and use the game level cameras without any additional code.

    2) Embed a copy of the character prefab which is used during edit and runtime. This means I can add cameras that look specifically at an object as well as other references. However it means I have to do some workarounds such as hiding the original characters and forcing their transforms to match the cutscene copy if I want organic systems to work properly.

    I feel like there's probably a 3rd approach I'm not considering here as I'm quite new Timelines and the API. For reference I use a custom character track that binds to a scriptable object which is just a data object with a GUID to easily find a character at runtime.

    Cheers for any advice!