Implement C++ function to animation sequence

Hello again, I’m a noob here. I implemented function inside C++ and wanted to do animation sequence. How do you communicate C++ with animation sequence? Because I have a boolean for it and it’s in inside C++ and only trigger it when bool is true.
Here’s a list of bug I found when doing it.

Steps to reproduce -Use player to open door or pickup item.
What is the current bug behavior? -Character stuck with one animation sequence.
What is the expected correct behavior? -Animation will play depending on current character function.
Possible fixes -Currently referring to this Call animation using input keys - Character & Animation - Unreal Engine Forums call on input as base reference.

Thank you in advance.