Reference GameObjects from Scene A inside a Timeline from async loaded Scene B?
I am trying to animate an object which was there in Scene A (Starting Scene) in a Timeline Animation which is in an async loaded Scene B.
I can reference it in the timeline and work with it during editing but as soon as I start the game, it loses the reference.
Any help would be appreciated :)
Answer by seant_unity · Jun 30, 2019 at 10:58 AM
The issue here is cross-scene references are not supported by serialization. The solution usually involves a script that binds the timeline once both scenes are loaded using playableDirector.SetGenericBinding(track, targetObject). For example, when SceneB load, the object has a script which searches for tracks in timelines/playableDirectors when a particular name, and binds itself to that timeline.
Your answer
Follow this Question
Related Questions
How to check when current scene has loaded? 0 Answers
Multiple active scenes updating but not rendering? 0 Answers
A doubt on loading Scenes 0 Answers
How do I make scenes switch properly c# 0 Answers