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

Question No way to get the global time of a clip that is in a Sequence?

Discussion in 'Timeline' started by Invertex, Sep 1, 2023.

  1. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
    I have tried looking through the code and am not seeing a clear way to get the actual Global time of a clip when it's in a sub-sequence instead of the root. The
    clip.start
    is returning its local time, not the time the clip is in the overall playable graph timeline.

    I see the Editor code uses its own unique data to show Global time that seems to only exist in Editor space code. Is this really the case? Being able to get global time seems like a very core function that should exist...

    If not, then I guess I will have to traverse the graph and add up the time...
     
  2. unity_7B7FCC2E6C8E17B17BAF

    unity_7B7FCC2E6C8E17B17BAF

    Unity Technologies

    Joined:
    Jul 6, 2022
    Posts:
    11
    Hey Invertex ,

    You can check this method GetInspectedTimeFromMasterTime(Double) that converts time from the master timeline to the current inspected timeline.

    I hope this helps ! If you have any further questions or concerns, feel free to reach out!
     
    fxlange and Yuchen_Chang like this.