Set/Get variables and function on another object

Hi, thank you for looking, I’ve tried getting this to work for days now, I am new to UE4 :slight_smile:

I’m trying to control an animation on an Animation Blueprint. I’ve made a C++ class with a few variables and functions to control the animation and then reparented the Animation Blueprint to this C++ class and I can see my variables and functions on the Animation Blueprint. Now, I would like to have an object that controls this Animation Blueprint through C++ code. I’ve tried FindObject, I can find the Actor that is based on my UAnimInstance C++ Class, but I can’t get access to UAnimInstance (or UMyAnimInstance which my custom class is called). For instance, I have a GetFloat() function, I can see it intellisense, so the included header works fine. I’ve also tried casting the found actor pointer to my AnimInstance classes, but that doesn’t give something I can further access. I’ve made the functions and variables public, but I can’t access them from the found actor, so I assume I have to get access the AnimInstance classes on the actor somehow. How would I got about this?

1 Like

I got it working, I made a GameInstance class, stored softpointers there which I can then locate through the GameInstance.