hi I have created a new AnimInstance because I want to include some custom variables in my animation graph, but I want to be able to edit them in my character.cpp file
so in my NewAnimInstance.h file ive got
and in my Player1Character.cpp i’ve written #include “NewAnimInstance.h”, but when I write AnimationNumber in the Player1Character.cpp, I get an error saying its not recognized. Im not that experienced with C++ so I dont know how to go about this, can someone help?
Please don’t take this the wrong way, but I’d suggest that you brush up on some introductory programming/C++ tutorials to get the basics under the belt.
As for your specific question, you first need a reference to an instance of your AnimInstance class, e.g.
Always check the basic stuff before everything else. If something is unrecognized it basicaly mean it didn’t find the declaration of the variable. And as the declaration of variable in C++ are often (not always) in the header file, you have to tell the cpp file which header file he should use. This is why you have to #include the corresponding header file where the required variable are.