- Home /
Get a list of Timeline Markers from code
Hi, I'd like to know if there's a way to get a list of all Markers from a PlayableDirector in code? I want to know if there are any markers is a certain Timeline. Thanks!
Comment
Answer by seant_unity · Nov 28, 2019 at 02:05 PM
The markers are stored on tracks, not on the timeline. You can retrieve the track used to store the markers at the timeline level using TimelineAsset.markerTrack, and retrieve the markers on any track using TrackAsset.GetMarkers();
The timeline is accessible from the playable director as follows: var timeline = (TimelineAsset) playableDirector.playableAsset;
Your answer
![](https://koobas.hobune.stream/wayback/20220612215417im_/https://answers.unity.com/themes/thub/images/avi.jpg)