# Cast failed in animation event graph? (Object Reference error)

**URL:** <https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [May 19, 2015, 5:12pm UTC](https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518 "2015-05-19T17:12:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_adc3f730](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_adc3f730](https://forums.unrealengine.com/u/anonymous_user_adc3f730)\
**Post date:** [May 19, 2015, 5:12pm UTC](https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518/1 "2015-05-19T17:12:07Z")

</div>

I have variables stored in my vehicle BP, i want to access those variables from my Vehicle Animation Instance BP via Cast. But  
I my cast keeps failing due to a reference error. I’ve tried “Try Pawn Owner” , “Get Player Controller”… etc but they  
all fail no matter what! Is there something i’m missing?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a7874504](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a7874504](https://forums.unrealengine.com/u/anonymous_user_a7874504)\
**Post date:** [June 27, 2015, 7:09am UTC](https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518/2 "2015-06-27T07:09:37Z")

</div>

I am assuming this is still outstanding as its crashing on mine 4.8

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f22261be](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f22261be](https://forums.unrealengine.com/u/anonymous_user_f22261be)\
**Post date:** [November 7, 2015, 5:30am UTC](https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518/3 "2015-11-07T05:30:12Z")

</div>

I have the same issue. Animation BP event graph, cast fail to MyCharacter. Other post suggest “Get Anim Instance” but that also doesn’t work.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_042f0076](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_042f0076](https://forums.unrealengine.com/u/anonymous_user_042f0076)\
**Post date:** [November 8, 2015, 5:30am UTC](https://forums.unrealengine.com/t/cast-failed-in-animation-event-graph-object-reference-error/30518/4 "2015-11-08T05:30:04Z")

</div>

this is the solution. shared by Moderator @Nawrot

> **[Casting between actors](https://forums.unrealengine.com/showthread.php?90472-Casting-between-actors&p=415235&viewfull=1#post415235)**
>
> Hey guys, I’m having a bit of a moment here. I’ve got got two Blueprints in my level that are both based on actor class. Each one contains different parts of my overall game system. One the general rules for the game, importantly for me one that is...

Easiest way (not most efficient) is to pass variables trough player pawn or player controller, because about everything can get their reference and can cast to it.  
When you get that working you probably undestand idea of casting and you will extend that to other blueprints.

So in player controller create variable “grab\_this” make it visible (small eye icon).  
In blueprint you choose create nodes: “get player controller” \> cast to “your player controller class name”  
Then as player controller get value of “grab\_this”

You have most basic communication.

Ps.  
That accessed none error is when you have invalid reference, you need to have it pointing to some actor in level.  
To get pointers to some blueprint (that must be placed in level!) do:  
**Get all actors of class “BP\_MasterSystem”, result is array. Get element 0 from that array and you have valid reference.**
