I'm trying to manage the third person character controller from the timeline, for example I would like to set a destination point and move the caracther in that position. How can I write a custom playable behaviour that take the control of the controller? Thansk
I think you can use this TransformTweenClip in AssetStore. https://assetstore.unity.com/packages/essentials/default-playables-95266 Or take a look at it to make your own.Maybe a track to set NavMesh destination.
acutally i need to just pass a float parameter to the animator from the behaviour or mixed behaviour script, yes i could use a navmesh but I'm tring to do it in this way, and I think there should be a way no?
The asset has a tool called Timeline Playables Wizard,you can use it to generate a animator custom track with a float parameter
I don't need a wizard , I'm tring to understand why animator.setfloat("ParamName",value), doesn't work from timeline
animator.setfloat("ParamName",value) should work from timeline. Does value have the correct value? Here's some sample code to set a float value in a clip and then use that value in a PlayableBehaviour. You will then be able to take that value and apply it to the animator. Code (CSharp): public class CustomAsset : PlayableAsset { [SerializeField] public float position; public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable<CustomPlayableBehaviour>.Create(graph); playable.GetBehaviour().position = position; return playable; } } public class CustomPlayableBehaviour : PlayableBehaviour { public float position; public override void ProcessFrame(Playable playable, FrameData info, object playerData) { Debug.Log("Float is : " + position); Animator animator = playerData as Animator; animator.SetFloat("MyCurve", position); } } [TrackClipType(typeof(CustomAsset))] [TrackBindingType(typeof(Animator))] public class CustomTrack : TrackAsset { }