Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is it possible to animate the elements of an array on a monobehavior?

Discussion in 'Animation' started by ctmctm5, Sep 24, 2020.

  1. ctmctm5

    ctmctm5

    Joined:
    Jul 1, 2013
    Posts:
    7
    If I have a monobehavior containing
    Code (CSharp):
    1. float[] values;
    is it possible to animate the individual cells of this array in an animation clip?

    I know that I could just have a gameobject for each cell, each containing a value and an index, animate those, and then write those back into the array, but I don't want to do this because it isn't exactly an elegant solution.

    What I'm really looking for is some way to manually override how the editor binds animation clips to properties.
     
  2. ctmctm5

    ctmctm5

    Joined:
    Jul 1, 2013
    Posts:
    7
    The reason I'm doing this is because I'd like to add Animation support to the asset I'm working on. The asset stores a bunch of theoretically animatable data (Vector3s, floats, etc.) but because it's all stored in arrays of variable length I can't animate anything.