- Home /
Can't find serialized field in Animation Window
Hi,
I noticed a problem within Unitys animation window. Using the Add Property button does not show the fields of my class. The fields I want to see are actually fields of another serialized class and I think this might be the problem.
Here a reproducable example configuration in a complety new project.
I have two classes, FooFront and FooBack:
[Serializable]
public class FooBack
{
public float Test;
}
public class FooFront : MonoBehaviour
{
public FooBack Foo;
}
The thing is, "Test" can of course be seen in the default inspector since it is serialized. But I cannot see it in the Animation Window. Only the Enabled field could be animated.
I tested this with the most recent version of Unity(5.6) and an older version (5.3).
Is it possible to get the field in the Backend class into the animation window? I need to animate the field "Test". Is there maybe an attribute that I might missed?
Answer by kornstar83 · Jun 08, 2017 at 12:53 PM
In the Image above you are trying to access the float in the Animation tab, yet your question is about accessing the float in the Animator.
I don't think that the float would be used during the creation of the animation so it shouldn't be relevant in the Animation tab, but in the Animator tab you could use it to change between animations.
Let me add that I am still just 2 years into program$$anonymous$$g, and about 1.5 years using unity, so for all I know maybe you do need to access that float in the animation tab, I just haven't seen anything like that yet but have seen accessing variables from the animator tab
Thanks for pointing out my mistake in the last line. Of course I mean animation window not the animator window. I want to animate the field "Test" in the backend class. Not to use the field as property in a statemachine.
ofcourse it wouldn't be that simple.
I decided to go and run some test on my own since this isn't something I have seen before and here are my results.
I added this script to an object in the scene:
public class GridTest : $$anonymous$$onoBehaviour {
[System.Serializable]
public class $$anonymous$$yClass
{
public float Test;
}
public int gridWidth = 1;
public int gridHeight = 1;
public GameObject testGO;
public bool testBool;
public float testFloat;
}
I found that not only was the float Test missing from the list in the animation tab but the gridWidth and gridHeight didn't show up either and they arent in custom classes. testGO, testFloat, and testBool all showed up though.
Sorry that this doesn't really help you but hopefully it will help someway, somehow.
Your answer
![](https://koobas.hobune.stream/wayback/20220612123751im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
How can I define two-dimensional curves? (like: circle) 1 Answer
Objects created in editor tool, fields reset on play and unable to serialize. 2 Answers
How to select an animation clip by index number? 7 Answers
Custom class does not get serialized 2 Answers