- Home /
Seeking a little more clarification with positioning timeline clips on track through script using seconds more accuratly.
https://answers.unity.com/questions/1732438/positioning-timeline-clip-by-script.html
hello for a project im working on i am creating timelines through code and placing timeline clips into the track through code as well.
This link was the only thing close to what i was looking for however i am using seconds instead of frames for my clip.start .
I do not think under the production cycle that i may have time to actually make a change to figuring out frames relative the the time stamps i've been provided. manually setting this is not an option either.
the accuracy wen using clip. start = float seems to be off by +-0.30 or more when viewed in seconds. so this is where i'm having a hard time. and i need to be within +- .05 +-.10 of my value.
For Example a start value of on the timeline 1.30 actually shows the start as 1.50 why is this?
can anyone help?
Answer by seant_unity · May 29, 2020 at 11:50 AM
The stored values in Timeline (clip.start) are always in seconds. Only the UI will show frames, and will snap time values in seconds to align to the closest frame.
From script no snapping occurs. Whatever time value you set, will be the value used. Timeline uses doubles instead of float for time values, so you should not be seeing any significant rounding errors until you get to very large time values.
thanks for replying directly to my answer. i'll post here from here on out to give people a chance to see.
so as i have found out. the ti$$anonymous$$g is for some reason normalized. if you look at 1:30. as 1.30 you expect the start of the clip in timeline to match. However it in fact does not it considers halfway through a second to be .5 so thats why im getting 1.5. so at 2:59 seconds we are actually at 2.99 or so the value in the box are not the same value at least based on my testing of looking at the clip start and matching it to the playhead position readout.
the problem i'm having is that i cannot match time to that as that doesn't work for anyone on the production $$anonymous$$m to timestamp to. my $$anonymous$$m is pulling time stamps from the audio files in audacity. if we cant rely on the unity ti$$anonymous$$g to be accurate to the ti$$anonymous$$g in audacity because unity clip ti$$anonymous$$g is based on renormalizing proper time to something different. then we are pretty much hosed.\
https://docs.unity3d.com/Packages/com.unity.timeline@1.2/manual/tl_settings.html
this is where i found out about it. it goes seconds frame subframes. if i can convert realtime to that then i can have something that works well.
I just figured it out. its in S$$anonymous$$PTE timecode and the time must be punched in in that format. just need to find a format converter. something like this
Answer by Davon_Allen_AofL · Jun 01, 2020 at 08:27 AM
Must take time and convert it to SMPTE format other wise the timing will be off. timeline playhead doesn't show time in SMPTE Timecode (seconds.frames.subframes) instead it shows in seconds.milliseconds so don't be confused.
I have yet to find a proper converter but most DAWs aside form audacity can display this time code signature.
Your answer
![](https://koobas.hobune.stream/wayback/20220612235545im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Timeline animations and positioning game objects relative to other objects 1 Answer
Animating Particles in Timeline 1 Answer
extending timeline GatherProperties, changing objects Parent 1 Answer
Unity TImeline - Animation clips passing through terrain 0 Answers
How do I convert the game to start time? 0 Answers