Timeline playables playing instantly?

Hey guys, I just got into timeline and i downloaded the default playables pack and changed it so it turned on lights on my car, but the playable executes instantly no matter where on the timeline

Are you using activation track? If yes, is that object disabled before you start?

Yes, I am using the activation track and if you mean the lights are disabled, yes.

Hi!
What version of unity are you using? Do you mind posting a small repro of your issue here or by opening a bug with the bug reporter so we could investigate?
thanks!

Using Unity 2017.3.0f3
Okay so i am using two scripts; ‘NormLightStartBehaviour’ (The timeline behaviour) and ‘CarControl’.
Car control changes the material of the lights from one without an emitter to one with.

    public void turnOn(string name){
        if (name == "norm") {
            normIsOn = !normIsOn;
        }
        else if (name == "turn") {
            turnIsOn = !turnIsOn;
            Blinker.Play ();
        }
        else if (name == "reverse") {
            revIsOn = !revIsOn;
        }
    }
    void Update(){
        if (!revIsOn) {
            foreach (GameObject go in Lights_Reverse) {
                go.gameObject.GetComponent<Renderer> ().material = reverse [1];
            }
        } else {
            foreach (GameObject go in Lights_Reverse) {
                go.gameObject.GetComponent<Renderer> ().material = reverse [0];
            }
        }
}

^^ In that case i am just showing Lights_Reverse, ‘norm’ and ‘turn’ have the same activation method.

using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;

[Serializable]
public class NormLightStartBehaviour : PlayableBehaviour{

    public string name;

    public override void OnGraphStart (Playable playable)
    {
        GameObject.Find("Lamborghini_Aventador").GetComponent<CarControl> ().turnOn (name);
    }
}

This is the NormLightStartBehaviour which i got from the Default playables pack.
Before the scene is played, by default the lights are off, and the ‘CarCaontrol’ script automatically turns them off if the bool is false so I have marked that out of the equation.


So no matter what, the light will turn on as soon as I hit play.
and i know its a problem with ‘NormLightStartBehaviour’ because, for example;
If I type ‘norm’ to turn on the normal lights it will turn on straight away, but if i change it to ‘reverse’ the normal lights won’t turn on and reverse lights will.

Not sure if this is a bug or me doing something wrong. Thanks.

Full ‘CarControl’ script

OnGraphStart is called when the timeline starts playing. You’ve got your lights turning on in OnGraphStart.

Ah alright cheers, whats the proper function to use?

OnBehaviourPlay()