Search Unity

Can't animate int on custom track/asset

Discussion in 'Timeline' started by nturleymb, May 4, 2020.

  1. nturleymb

    nturleymb

    Joined:
    Mar 31, 2020
    Posts:
    6
    I have a PlayableBehaviour that looks like

    Code (CSharp):
    1. [System.Serializable]
    2. public class BindableObjectAssetBehaviour : PlayableBehaviour
    3. {
    4.     public Color ColorValue = Color.white;
    5.     public float FloatValue = 0f;
    6.     public int IntValue = 0;
    7.     public bool boolValue = false;
    8. }
    9.  
    10.  
    It looks fine in the inspector (everything is serialized)

    upload_2020-5-4_11-44-23.png

    However in my track, I can't animate the int value. All the others work fine. Any clues as to why this might be? upload_2020-5-4_11-43-52.png
     

    Attached Files:

  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Integer animation isn't supported when animating playable fields.
     
  3. nturleymb

    nturleymb

    Joined:
    Mar 31, 2020
    Posts:
    6
    Got it.

    Any particular reason? It works with Animator tracks I think? I guess the workaround would just be to floor/round another float value, but no easy way to snap the curve to an int value I'm guessing.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No real technical reason. The playable animation system is not the same as the regular animation system, and the task to add integer support just never had priority.