Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Timeline to only play once.

Discussion in 'Timeline' started by Trashrat92, Mar 16, 2024.

  1. Trashrat92

    Trashrat92

    Joined:
    Jun 6, 2020
    Posts:
    1
    Perhaps this questions show a fundemental missunderstanding on how and why to use timeline but either way hopefully I will learm

    So I have a moment in the game where I would like a cutscene of an exterior location to play, and then for the interior location level to load. The issue i'm having is that when the player then enters that exterior location from inside the timeline plays again. What would be the best work around you can think for this, to only have the timeline cutscene play once, and not every time the level is loaded.

    Thank you
     
  2. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    87
    I use Persistence Manager that tracks the use of objects. Create a "Persistence MonoBehaviour" that registers itself with the manager on Awake. It also checks to see if it was previously used. If it was used, it destroys the gameObject. Attach this to your playable director. When the cutsceen is done, log the object as used in the manager.