Search Unity

Referencing Scene Objects in Custom Clip

Discussion in 'Timeline' started by Tehenauin, Jul 13, 2021.

  1. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    What I want to achieve is the following:

    I want to make a Custon Timeline Clip, that moves the Camera to the position of a certain Target (Transform). I would have liked to have the Camera reference in the Track bindings and the Target Transform reference in the Clip itself. Of course this is not possible because the Playable Asset is a Scriptable Object.
    Does Someone know how to achieve something linke this in a good way. The only way I could come up with is having a Monobehaviour referencing different targets binded to the Track and let the clip only know the ID of the certain target. But I really don't like that.
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    This is what Exposed References are for. You can put an exposed reference in your clip, and the actual referred object will be stored in the PlayableDirector, which can save scene/prefab references.
     
    brian-nielsen and Tehenauin like this.
  3. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    Now everything makes a lot more sense to me! Thank you! This is exactly what I was looking for!
     
    DavidGeoffroy likes this.