# Set/Get variables and function on another object

**URL:** <https://forums.unrealengine.com/t/set-get-variables-and-function-on-another-object/548519>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 4, 2022, 11:30am UTC](https://forums.unrealengine.com/t/set-get-variables-and-function-on-another-object/548519 "2022-05-04T11:30:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cybermind13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cybermind13](https://forums.unrealengine.com/u/Cybermind13)\
**Post date:** [May 4, 2022, 11:30am UTC](https://forums.unrealengine.com/t/set-get-variables-and-function-on-another-object/548519/1 "2022-05-04T11:30:26Z")

</div>

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

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?

---

<div class="post-metadata">

**Author:** ![Cybermind13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cybermind13](https://forums.unrealengine.com/u/Cybermind13)\
**Post date:** [May 8, 2022, 8:55am UTC](https://forums.unrealengine.com/t/set-get-variables-and-function-on-another-object/548519/2 "2022-05-08T08:55:25Z")

</div>

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