I am looking to make a custom playable to use on timeline where I can edit a vector 3 on a curve just like the Transform timeline playable. I have researched custom playables but cant find anything about adding a curve editor like the Transform timeline playable.
I have attached an image of what I am trying to create as a custom playable
Any help would be great, thanks!
The infinite clip recording mode (shown in the example image) is exclusive to animation tracks. However you can record directly to the properties of the custom clips.
Here’s how using an example using a modified Light Control Clip from the Default Playables examples on the asset store:
[Serializable] // 1. Make the playable behaviour serializable
public class LightControlBehaviour : PlayableBehaviour {
public Color color = Color.white; // 2. Recordable properties must be custom fields
public Vector3 vector3Parameter; // floats, colors and vectors are all 'recordable'
...
}
[Serializable]
public class LightControlClip : PlayableAsset {
// 3. Have a public field that acts as a template in your clip
public LightControlBehaviour template = new LightControlBehaviour ();
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) {
// 4. Use the template to initialize the playable behaviour with default values
var playable = ScriptPlayable<LightControlBehaviour>.Create (graph, template);
return playable;
}
}