Hi,
As mentioned in the title, I want to design a start guide for the game by timeline. But the demand not only animations or particles, we also need some interaction featcher. The interaction featcher isn’t base on time, but controled by events. Can I add this to Timeline?
I have read the thread “[Code Example: How to Detect The End Of The Playable Clip](http:// Code Example : How To Detect The End Of The Playable Clip )”. and find some way. Is there any more examples? Can I control the clips freely?
If I understand correctly, you would like to control when a clip starts and ends based on events that occur, presumably from events posted from outside the timeline?
Technically, this is possible to do with Timeline using a custom track and a custom mixer PlayableBehaviour that replicates some of the functionality internal to timeline such as enabling input Playables (i.e. clips) and setting their local time inside the Mixers PlayableBehaviour PrepareFrame call.
However, you may want to consider simply using a separate Monobehaviour that provides the interaction functionality, possibly playing a second timeline as required. Two timelines can play simultaneously, and if they animate the same object the timeline that started later takes priority.
Yes, I want to set a person in scene, move to target, sit, order, or some other actions. At first, I plan to use a track, create several clips, each for one action. But it seems not so easy(I’m new for Timeline), all the actions can only controled by event, not time. So I need a way to detect, and trigger start and end of a clip. Even more, after start the clip, I must let the time of the track stopped, until the end event of action. All these don’t look simple.
Maybe as you said, use different tracks, not clip, for each action, is better, I found API for start and end of a track. I think I can try this. Is there any disadvantage to use too much tracks in a Timeline?
There isn’t really a disadvantage to too many tracks.
However, it sounds like the default behaviour of timeline (time-based sequencer) is exactly the opposite of what you want (an event-based sequencer), but you’d like the timeline UI. Trying to make the playback of timeline fit your needs could prove tricky, as it wasn’t designed for it. Not impossible, some users have successfully done similar things like pause timelines while waiting for dialogs.
One suggestion: Use custom tracks and clips that do nothing (e.g. create default playables). Use a playable director for authoring only. Then, at runtime have your own playback engine (via a script) that reads the tracks and clips from the timeline asset.
That way you can treat the timeline track with a lot of clips as an event-based sequencer, and each clip can carry the state you need by using custom playable assets to define the data for that state.
There may be other event-based sequencers as well that are better suited to the problem.
Thank you for reply. Because besides the person’s action, I also need to do some other things, just as decorate animations and particles, they are time-based and suitable to use Timeline, so I want to Integrate the person’s action together with them, in one Timeline system…I’ll try your suggestion.