Can't add an animation variable into the script
I'm making a 3D RPG game in Unity, and I don't know why I can't create an animation variable. Although I type the following codes,there is no place for me to drag the animation into the script of the player inspector.
Normally the "anim" that I typed in should be shown in black color which representing a variable, but I don't know why it is showing in green.
private Animation anim;
thank you for any help!
Answer by SneakyLeprechaun · Aug 21, 2017 at 03:17 AM
You need to make the variable public for it to be seen in the inspector.
Answer by Simonwan · Aug 21, 2017 at 03:29 AM
Oh I get it,sorry for this stupid question. I am a Newbie to C# and Unity, thanks for your help
No it's fine, I've made mistakes that have driven me insane, despite having a very simple fix.
Your answer
Follow this Question
Related Questions
Can't seem to get my animations to work proper 1 Answer
Need help Script error, i got 4 errors here is my script 1 Answer
[C#]How to save a list of items to use in another script and it's not a player prefs type of list? 0 Answers
How to create keyframe from animation tab with helped script? 0 Answers
3D Walk animation script errors 1 Answer