Global variable on the Anim Graph

create blueprint interface, from the content browser,click on new, then choose miscellaneous → blueprint interface.
open it, then create a function after that define the variable and save it, then you have to go to your char blueprint, and add the bp interface from blueprint props, and you need to
set the variable to the bp interface function, and then go to the animation blueprint to add bp interface, the same way as in your char bp and call the function.
i hope you understand what i am talking about :D, because I am so bad at explaining things