# How do I reference my Animation Blue Print in a class?

**URL:** <https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 3, 2014, 6:11pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566 "2014-04-03T18:11:32Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [April 3, 2014, 6:11pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/1 "2014-04-03T18:11:32Z")

</div>

How do you reference variables in your animation blue print in a class, or how do you reference variables in a class from your animation blue print?

---

<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:** [April 3, 2014, 6:15pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/2 "2014-04-03T18:15:06Z")

</div>

#Set Custom Anim BP Vars in Code

I wrote a wiki tutorial on this here!

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

PS: has pictures!!!

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [April 3, 2014, 6:24pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/3 "2014-04-03T18:24:50Z")

</div>

This appears to be through code. Is there no way to do this in blue print itself?

---

<div class="post-metadata">

**Author:** ![Steve\_Allison](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Steve\_Allison](https://forums.unrealengine.com/u/Steve_Allison)\
**Post date:** [April 3, 2014, 6:50pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/4 "2014-04-03T18:50:49Z")

</div>

Hey Thumper,

To reference your AnimBP from another Blueprint, you’ll need to call the Mesh being used on the Character or Pawn in question, then get that Mesh’s Anim Instance, and Cast it back to the AnimBP you are using. That will let you get/set variables in that instance of your AnimBP. Here are some examples of what that node setup would look like:

_Edit: This example is based on the Third Person (Blueprint) Template_

From a Character Blueprint:

 ![3148-getanimbpfromcharacter.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/6/6463dc27e1c633390285b677786a2a8c20ba1130.png)

From a Level Blueprint:

 ![3149-getanimbpfromls.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/7/797430c3b7593a773a2a34479d75cf06732b9215.png)

If you have any questions about this setup, please let us know!

Cheers,

-Steve

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [April 3, 2014, 7:25pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/5 "2014-04-03T19:25:28Z")

</div>

Does this only work for “character” or “pawn” classes? What about an actor class? For instance. I have an actor class that has a cylinder rigged. My class gets a variable updated every frame. Now I need that variable inside the cylinders anim BP. So Cylinder class → cylinder’s AnimBP.

---

<div class="post-metadata">

**Author:** ![Steve\_Allison](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Steve\_Allison](https://forums.unrealengine.com/u/Steve_Allison)\
**Post date:** [April 3, 2014, 7:29pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/6 "2014-04-03T19:29:30Z")

</div>

Yes, it should work for any Actor blueprint. If you have an actor blueprint with a Skeletal Mesh Component you need to reference, you’d just call the Skeletal Mesh Component in your blueprint and use the same node setup. Didn’t mean to sound like this was exclusive to Character/Pawn, those were just the first to come to mind for examples.

If you have a specific setup you’re having trouble with, post a screenshot of your Eventgraph and we’ll be glad to help guide you in the right direction.

Cheers,

-Steve

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [April 3, 2014, 7:37pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/7 "2014-04-03T19:37:07Z")

</div>

I should have tried before asking anyhow, My bad, I’ve been puzzled by this for a week now so I was just assuming I needed more info. I just set it up using skeletal mesh and it worked. Huge thanks! I appreciate it a great deal.

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [April 5, 2014, 9:42pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/8 "2014-04-05T21:42:17Z")

</div>

An answer to this is to use the skeletal variable in the class BP, from the skeletal object you can cast to the Anim BP that you want, then you can set variables in it from directly in your class.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a21d0d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a21d0d5](https://forums.unrealengine.com/u/anonymous_user_9a21d0d5)\
**Post date:** [November 20, 2014, 12:39am UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/9 "2014-11-20T00:39:32Z")

</div>

I know this is old, but I have a question if it’s still a possiblity, it refers to the images just above…

In the first image you have Set Speed but with a target node. How did you get that target node, it doesn’t appear on mine.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [November 20, 2014, 4:35pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/10 "2014-11-20T16:35:47Z")

</div>

Hi ,

drag off of the Cast to node from the blue output pin that says "As ", then type in the variable you want to set.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f7c0f7221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f7c0f7221](https://forums.unrealengine.com/u/anonymous_user_f7c0f7221)\
**Post date:** [January 26, 2015, 2:05pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/11 "2015-01-26T14:05:59Z")

</div>

I know this is kinda of ancient now but could you help me in my thread? If so, please follow the link : [thread][1]

[1]:

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cca41ab5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cca41ab5](https://forums.unrealengine.com/u/anonymous_user_cca41ab5)\
**Post date:** [February 10, 2016, 10:26pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/12 "2016-02-10T22:26:23Z")

</div>

Thanks for asking this question. I was having a similar issue.

---

<div class="post-metadata">

**Author:** ![youthnick](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@youthnick](https://forums.unrealengine.com/u/youthnick)\
**Post date:** [July 14, 2016, 4:10am UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/13 "2016-07-14T04:10:44Z")

</div>

This helps me !Thx dude 🙂

---

<div class="post-metadata">

**Author:** ![pprkgraphiks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pprkgraphiks](https://forums.unrealengine.com/u/pprkgraphiks)\
**Post date:** [December 11, 2016, 2:48pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/14 "2016-12-11T14:48:13Z")

</div>

hi. .

I want to make that snowman is growing ,when i press G key in other Actor Blueprint. only works in actor BP,no character or no pawn.

Thus i made that cast to animation blueprint’s bool value from Actor BP. but it doesn’t works

How can i manage bool value in animation Blueprint? i have nothing to do with from Actor BP to Anim BP / from Anim BP to Actor BP.

thx for read my thread and if you have solution of this,I really wish and appriciate to attach with blueprint pictures. thx!

 ![Call1.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/9/b9ae6d23e26b178eaa9ce2d7c92b64101250d154.jpeg)

 ![Call2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/a/ea6495c057730d2d3495b11131c39de1c95abcd8.jpeg)

---

<div class="post-metadata">

**Author:** ![casinowilhelm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@casinowilhelm](https://forums.unrealengine.com/u/casinowilhelm)\
**Post date:** [May 18, 2020, 3:59pm UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/15 "2020-05-18T15:59:48Z")

</div>

Hello, this doesn’t work. Has anything changed in the last 6 years to make this not work?

---

<div class="post-metadata">

**Author:** ![ryancowley](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ryancowley](https://forums.unrealengine.com/u/ryancowley)\
**Post date:** [July 25, 2020, 10:29am UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/16 "2020-07-25T10:29:37Z")

</div>

This works fine still, what are you struggling with?

---

<div class="post-metadata">

**Author:** ![J\_Snapper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/j_snapper/32/924935_2.png) [@J\_Snapper](https://forums.unrealengine.com/u/J_Snapper)\
**Post date:** [April 29, 2024, 8:52am UTC](https://forums.unrealengine.com/t/how-do-i-reference-my-animation-blue-print-in-a-class/279566/17 "2024-04-29T08:52:41Z")

</div>

Are there any way to avoid casting?
