How can i cast an AnimInstance to MyAnimBlueprint in c++?

Hi everyone, i’m new to ue4 and i’m trying to write in c++ this function:
I created my character in c++ and attached to it a combat component, i successfully set the anim instance of the combat component but now i can’t figure out how to cast the anim instance to an animation blueprint i’ve already created.

If you want to access the stuff created in blueprint from C++, then C++ doesn’t know much about the blueprints you create, to access the variables you would have to go through property link, which would be nasty in normal, non specific usage.

I recommend making a MyAnimInstance class in code that derives from AnimInstance and then create your blueprint based on that. This way you can make virtual functions that can be implemented in blueprints/code or variables that can be set in blueprint/code and you will be able to access them from both code/blueprint (editor).