Search Unity

Question Timeline on one GameObject to animate a different object

Discussion in 'Animation' started by ThatProgrammerJack, Apr 27, 2022.

  1. ThatProgrammerJack

    ThatProgrammerJack

    Joined:
    Jan 6, 2019
    Posts:
    32
    Hi, all. I’m trying to make a system whereby my player can interact with an object, which will cause a game sequence to play. For example, if the player interacts with a book on a table, the controls will be suspended temporarily, some audio will play, a subtitle will appear, maybe some post processing effects will occur, and then the controls will go back to normal.

    I have a PlayableDirector component and a custom script on the object in question. I’ll use the custom script to take input from an InputManager, detect the Player, and pause the Player’s controls. The problem is, how can I use the timeline to animate all the necessary values if they aren’t on the GameObject where the PlayableDirector is attached?
     
  2. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599


    1:14 in the video :)
     
    ThatProgrammerJack likes this.
  3. ThatProgrammerJack

    ThatProgrammerJack

    Joined:
    Jan 6, 2019
    Posts:
    32
    That’s extremely useful! So basically I can have a playable on one object with animation tracks for each other GameObject I want to animate?
     
  4. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    Yep, exactly.
     
    ThatProgrammerJack likes this.