# Cast to CharBP failed, objectiv pin wrong refreence?

**URL:** <https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590>\
**Category:** Blueprint\
**Tags:** cast-failed, unreal-engine, fail, question, Blueprint\
**Created:** [March 18, 2015, 6:42pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590 "2015-03-18T18:42:14Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 18, 2015, 6:42pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/1 "2015-03-18T18:42:14Z")

</div>

Hi!

I trying to cast from a “Blueprint class” to a “Animation Blueprint” but it fails and i don’t know why, i’m guess that the object pin has the wrong reference but can’t figure it out how it should be. Pic 1 calls the function inside the animation Blueprint from the “Blueprint class”. When i run the game it prints fail.  
Pic 1

 ![34801-cast+failed+1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/a/6daded8104061f5719b427e3940bfb872fbcc8d6.png)

Pic 2

 ![34802-cast+failed+2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/a/85a9d40f959e6da091c04203d100bf5da9ecf6ae.png)

Grateful for any help!

---

<div class="post-metadata">

**Author:** ![Erasio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erasio](https://forums.unrealengine.com/u/Erasio)\
**Post date:** [March 18, 2015, 11:39pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/2 "2015-03-18T23:39:11Z")

</div>

What’s the patent class of the BP you created and why do you get the owner of the character movement component which can only be sold since nothing is inserted into that node and getting that this way is rated silly. You could just use “Self”.

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 19, 2015, 3:17pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/3 "2015-03-19T15:17:00Z")

</div>

The BP in the first pic has the parent class of Character, the BP in the second pic is it’s Anime BP(Overwatch BP). I don’t realy get what you mean with the second part in your reply.

I can’t type self in the cast to overwatch BP function, and i can’t leave it blank, that would still make the cast to fail. What I’ve done above in the pics aren’t working either so that’s wrong too :P.

---

<div class="post-metadata">

**Author:** ![Erasio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erasio](https://forums.unrealengine.com/u/Erasio)\
**Post date:** [March 19, 2015, 4:06pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/4 "2015-03-19T16:06:13Z")

</div>

Well yes. You can’t plug that in there because "OverwatchBP is not a character nor a controller. It could in theory be one but it isn’t so plugging it in will always fail.

You need a legit reference to that bp. There are quite a lot of ways and I’m not entirely sure how it’d be best in your case. But you can’t just cast it and expect it to be there.

This could help: [https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/BlueprintComms/index.html](https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/BlueprintComms/index.html)

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 19, 2015, 4:28pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/5 "2015-03-19T16:28:21Z")

</div>

I glanzed at it and i believe the solution is somewhere in there!

Thanks for your help! I tip my hat…

I guess this will get abit more complicated when you want it to work in multiplayer? Say someone does something on one persons end and it replicates across all others characters if they use the same reference. Maybe that makes less seens when i try to explain it in English…

Thx anyway

---

<div class="post-metadata">

**Author:** ![Erasio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erasio](https://forums.unrealengine.com/u/Erasio)\
**Post date:** [March 19, 2015, 4:39pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/6 "2015-03-19T16:39:00Z")

</div>

Well if done properly it’s exactly the same for multiplayer. You just have to do a little extra work for replication.

But don’t underestimate it. This is object orientated programming. It’s not super complicated but you have to wrap your head around it initially which is programming.

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 19, 2015, 5:23pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/7 "2015-03-19T17:23:05Z")

</div>

After view and testing now for awhile, it doesn’t solve my problem. Seems weird to me i can’t cast from my Character Blueprint to my AnimationBP to call a function.

Making a object reference doesn’t seem to work cause it the animationBP doesn’t have any instances of it in the level.

---

<div class="post-metadata">

**Author:** ![Erasio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erasio](https://forums.unrealengine.com/u/Erasio)\
**Post date:** [March 19, 2015, 5:53pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/8 "2015-03-19T17:53:59Z")

</div>

Well how do you want to call it then? If an object doesn’t exist it’s not loaded and literally impossible to call.

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 19, 2015, 6:22pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/9 "2015-03-19T18:22:07Z")

</div>

Find it weird that there isn’t (or more like haven’t figure out :P) a simple way to just say this characters animation BP, what ever it is, call this function with this name (string).

Gonna change it up and cast boolens to trigger functions instead… becomes alot more like spaggti code now.

---

<div class="post-metadata">

**Author:** ![1l2Hawk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/1l2hawk/32/927115_2.png) [@1l2Hawk](https://forums.unrealengine.com/u/1l2Hawk)\
**Post date:** [March 19, 2015, 7:05pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/10 "2015-03-19T19:05:36Z")

</div>

Try to think of Casting as going down a tree of children to access a function at a lower level that’s not available to all the parents further up that tree. For example, say you had a hierarchy of blueprints going Animal BP → Dog BP → Dalmation BP… And say you want to call a function “CountSpots” on a Dalmation that is a subclass of Dog, which is a subclass of Animal. Starting from a node such as “Get Animal”, who doesn’t have a counting spots function, the way to get there is to go Get Animal → Cast to Dalmation → Count Spots.

So the issue you’re having is you’ve started with a Get Pawn Owner node, which should return a Player Controller reference. Anim Blueprints do not exist further down the tree starting at Player Controller. Anim Blueprints exist as a property on a Skeletal Mesh instead.

The mesh should already be a component in your character blueprint, so drag that from the variable list out into your blueprint. Pull off from its pin and choose “Get Anim Instance” (Target is a SkeletalMeshComponent) to get the generic Anim BP on this mesh. Now Cast from that to your Overwatch BP and you’ll have access to your PreVaultTop function.

---

<div class="post-metadata">

**Author:** ![Erasio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erasio](https://forums.unrealengine.com/u/Erasio)\
**Post date:** [March 19, 2015, 7:22pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/11 "2015-03-19T19:22:47Z")

</div>

Did you look at the anim graph yet? That’s usually used for animation handling.

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 19, 2015, 8:02pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/12 "2015-03-19T20:02:06Z")

</div>

ofcourse, in my mind what i’m trying to descibe seems like the most logical and straight forward approach. Maybe the best way is to redesign my logic so it utilies the anime graph more.

---

<div class="post-metadata">

**Author:** ![1l2Hawk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/1l2hawk/32/927115_2.png) [@1l2Hawk](https://forums.unrealengine.com/u/1l2Hawk)\
**Post date:** [March 19, 2015, 8:13pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/13 "2015-03-19T20:13:08Z")

</div>

The way is thru Mesh → Get Anim Instance … see my answer below.

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [March 21, 2015, 10:38am UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/14 "2015-03-21T10:38:43Z")

</div>

Thank you! It works now.

You been very helpful!

---

<div class="post-metadata">

**Author:** ![Elea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elea](https://forums.unrealengine.com/u/Elea)\
**Post date:** [August 6, 2017, 12:31am UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/15 "2017-08-06T00:31:06Z")

</div>

can u tell us how u fix this Pls?

---

<div class="post-metadata">

**Author:** ![Blackrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackrock/32/489271_2.png) [@Blackrock](https://forums.unrealengine.com/u/Blackrock)\
**Post date:** [August 10, 2017, 7:03pm UTC](https://forums.unrealengine.com/t/cast-to-charbp-failed-objectiv-pin-wrong-refreence/311590/16 "2017-08-10T19:03:56Z")

</div>

Well if you look at the first pic in this post i didn’t have the understanding that you needed to reference the skeletal mesh in the Blueprint you want to cast to the anime BP. / The target is Character (Character movement) ← should say The target is Character (“What ever you named your skeletal mesh”)
