# My Cast doesn't work but ingame it seems to work?

**URL:** <https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561>\
**Category:** Character & Animation\
**Tags:** unreal-engine, cast, UE4, question, Blueprint\
**Created:** [November 21, 2014, 7:34pm UTC](https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561 "2014-11-21T19:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5c86276a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5c86276a](https://forums.unrealengine.com/u/anonymous_user_5c86276a)\
**Post date:** [November 21, 2014, 7:34pm UTC](https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561/1 "2014-11-21T19:34:25Z")

</div>

Well I just tried setting up my AI and for some reason the anim blueprint won’t cast to the character blueprint, then I checked my character because I couldn’t find the error and even there it says cast failed but in game everything is totally fine, it plays all the animations etc…  
I am totally clueless

 ![21867-untitled-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/3/53356e43e95504a6a860a3900fd0bcd4d747eb94.jpeg)

---

<div class="post-metadata">

**Author:** ![Justin.Dooley](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/justin.dooley/32/1194553_2.png) [@Justin.Dooley](https://forums.unrealengine.com/u/Justin.Dooley)\
**Post date:** [November 21, 2014, 8:18pm UTC](https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561/2 "2014-11-21T20:18:13Z")

</div>

check what you are previewing in the anim blueprint. The default “Preview mesh” is not your hero class. If you run it in game and actually select your character instance you should see it runs correctly.

Just in case you did not know, the preview instance can be selected at the top of the screen. If you run your project in an editor window it will populate with the instances that have spawned in your game. you can then select each one individually and debug them.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5c86276a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5c86276a](https://forums.unrealengine.com/u/anonymous_user_5c86276a)\
**Post date:** [November 21, 2014, 8:59pm UTC](https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561/3 "2014-11-21T20:59:59Z")

</div>

Tried that, doesn’t work when doing that it still outputs cast failed, even if in my character…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcdd396d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcdd396d](https://forums.unrealengine.com/u/anonymous_user_bcdd396d)\
**Post date:** [November 21, 2014, 10:26pm UTC](https://forums.unrealengine.com/t/my-cast-doesnt-work-but-ingame-it-seems-to-work/299561/4 "2014-11-21T22:26:29Z")

</div>

Hi ,

Make sure Your “Cast to Hero” is referencing the correct name of your character blueprint. (ie. The name of your Character blueprint in this instance should be “Hero” not “Hero\_BP” “HeroCopy” “Hero2” etc.)

This may not be your issue but is a common occurrence. If this does not resolve your issue let me know.

Thanks
