# How do I get my AnimBlueprint in c++?

**URL:** <https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628>\
**Category:** Character & Animation\
**Tags:** casting, unreal-engine, cast, UE4, CPP, question\
**Created:** [March 18, 2015, 11:02pm UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628 "2015-03-18T23:02:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wrekk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wrekk](https://forums.unrealengine.com/u/Wrekk)\
**Post date:** [March 18, 2015, 11:02pm UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628/1 "2015-03-18T23:02:57Z")

</div>

Hello.

I’m trying to get my AnimBlueprint in c++, but with no luck unfortunately. I tried this:

```
Cast<MyAnimBlueprint>(GetMesh()->GetAnimInstance());

```

But it doesn’t work obviously, and I just don’t know what to cast as. ☹

Any ideas? 🙂

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [March 18, 2015, 11:13pm UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628/2 "2015-03-18T23:13:18Z")

</div>

That’s because the AnimInstance is not exactly the blueprint.

What exactly do you want to do? Get access to the Instance to call a Montage or do you want the AnimBlueprint in your C++ Class to set it like you would do inside the BP?

---

<div class="post-metadata">

**Author:** ![Wrekk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wrekk](https://forums.unrealengine.com/u/Wrekk)\
**Post date:** [March 18, 2015, 11:25pm UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628/3 "2015-03-18T23:25:38Z")

</div>

I’d like to set two variables of my AnimBlueprint in my PlayerCharacter code.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [March 19, 2015, 9:06pm UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628/4 "2015-03-19T21:06:57Z")

</div>

#Two Wikis For You!

I have two wikis on this subject!

**custom C++ Logic for anim bp**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

**custom C++ vars for anim bp**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![Wrekk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wrekk](https://forums.unrealengine.com/u/Wrekk)\
**Post date:** [March 20, 2015, 12:46am UTC](https://forums.unrealengine.com/t/how-do-i-get-my-animblueprint-in-c/311628/5 "2015-03-20T00:46:03Z")

</div>

Thank you, Rama! This solves my problem. 🙂
