Search Unity

runtime AnimationClip keyframe info ?

Discussion in 'Animation' started by spacefrog, Aug 30, 2019.

  1. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    So.. as i understand, there is still no way to access keyframe info of an AnimationClip at runtime ?
    Even just simple things like number of keyframes ?
    BTW: i'm aware of the UnityEditor access side of them, strictly speaking about runtime here ...
    Anyone can give a definite answer to this ?
     
  2. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Anybody got an idea ?
    Would help if someone knowing would simply confirm: getting animationclip keyframe info at runtime is not possible at all :)
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Not possible as far as I know.

    The only options I know of are to use a parameter with the same name as a particular curve in your Animator Controller so it will automatically update that parameter by evaluating the curve or to extract what you need in the editor and serialize it separately.
     
  4. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Thanks for the confirmation, ended up doing the serialization of the info myself ...