- Home /
Animation variable via Inspector
Hi all, i have a question, i have been looking on the forums for 2 nights now, but i can't find it so here goes:
I have to animate alot of doors in my scene, so therefore i wanted to make 1 script, i wanted to make a variable which would count for each animation.
But the problem is, i dont know how to get a variable for animations, because obviously, you cannot make it like this:
var animation : GameObject because animations are not GameObjects but files in your projects folder.
So how i can make a var which can access animation files? Or doesn't it work like that.
If there is another way to do this, all help is welcome.
Thanks in advance.
I think you can use var animation : AnimationClip; but I'm just guessing... could also try Animation, AnimationState, AnimationEvent (but I think Clip is the best guess....)
Greetz, $$anonymous$$y.
Your answer
![](https://koobas.hobune.stream/wayback/20220612172449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
issue rendering animation on button click 1 Answer
Assigning animations in inspector? 1 Answer
Animation Variable Not Assigned? 1 Answer
Enable animation C# 0 Answers
switching to legacy makes the animation preview tiny 0 Answers