- Home /
Using default generated StateMachineBehaviour script has errors
In an animation controller, on an animation state, I used the "Add Behavior" button to generate a C# script. The script came pre-loaded with some using statements and commented out overrides. I uncommented one override and the Unity compiler is throwing errors saying
Assets/rotate_180.cs(8,43): error CS0246: The type or namespace name animator' could not be found. Are you missing a using directive or an assembly reference? Assets/rotate_180.cs(8,62): error CS0246: The type or namespace name
animatorstateinfo' could not be found. Are you missing a using directive or an assembly reference?
I do have the previous version of unity installed (if that might have anything to do with it) but right now I am using Unity 5 in 2D.
What is wrong?
Answer by nitrox945 · Jan 19, 2021 at 05:10 AM
I have the same problem if anyone has a solution. I'll post mine if I find one.
EDIT: I found the solution. Ensure that the type names as well as the function are in camelcase. Looks like VS studio's uncomment hotkey put everything in lowercase?
Your answer
Follow this Question
Related Questions
Reflection Type Load Exception 2 Answers
Why does my CPU-heavy A/I run so slow in Unity? 1 Answer
Generic method and factory pattern 3 Answers