# Asking for help for casting into AI Controlled Pawn

**URL:** <https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine, Event, question\
**Created:** [September 26, 2024, 1:25pm UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412 "2024-09-26T13:25:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 26, 2024, 1:25pm UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/1 "2024-09-26T13:25:21Z")

</div>

Hi guys, Im new to Unreal Engine i found a problem i cant make my turret cast to an AI controlled pawn which i duplicate the third person character blueprints and delete all events.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/2/0b2b44952ac8504bb537e921a3c75a098b703109.png)

![image_2024-09-26_171456417](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/5/aa53da6d248ec0bfa1f03e0c09d745003b7a036a.png)

![image_2024-09-26_171512939](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/d/bbdb6ae212412033cc3dcb590d4d558fb48436c0.png)

![image_2024-09-26_171530177](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/7/417b8a2ccbca1ee0f2ed05ca21637e90f74f812b.png)

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 26, 2024, 1:33pm UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/2 "2024-09-26T13:33:12Z")

</div>

Did you try plugging the “Get AI Controller” node into the object pin of the “Cast To” node?

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 27, 2024, 6:06am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/3 "2024-09-27T06:06:34Z")

</div>

Im sorry for the late reply but can you tell me more specific? Because im still new

Thank you for your reply!

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 27, 2024, 6:12am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/4 "2024-09-27T06:12:50Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/3/1b3b653c270473fb1d980119ca20916c0f019f8c.png)

I found this but this said the BP\_Enemy\_Base itself doesnt inherit from the AI Controller. The reason maybe because i copy the third person character and i delete all event.

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 27, 2024, 10:34am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/5 "2024-09-27T10:34:59Z")

</div>

Sorry for my initial suggestion, I couldn’t understand the context correctly. I think this is inside your AI Controller blueprint, right? You can just get the “Get Controlled Pawn” node, leave it’s target pin empty _(which will be set to self by default)_ and plug it’s return value into the object pin of your Cast To node

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 27, 2024, 10:40am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/6 "2024-09-27T10:40:09Z")

</div>

This is still in my BP\_Turret. Im trying to get the pawn sensing to cast to my BP\_Enemy\_Base so it can shoot at my AI.

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 27, 2024, 10:44am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/7 "2024-09-27T10:44:07Z")

</div>

Oh right 🤣 That’s not a custom event! Ok it makes sense now. In that case, the connections you showed in your first image should be correct! Does your cast fail? It shouldn’t I think.

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 27, 2024, 10:45am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/8 "2024-09-27T10:45:07Z")

</div>

I created the Pawn Sensing by add a sensing in my Pawn Sensing. However, i thought it was right in the beginning but it wont work. It said it’s failed to cast to my BP\_Enemy\_Base.

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 27, 2024, 11:02am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/9 "2024-09-27T11:02:52Z")

</div>

Here’s a quick way to cast to any blueprint under the same class which will work for sure. You can get the “Get All Actors of Class” node, select your enemy’s character blueprint from the dropdown menu inside that node, then drag out a “Get” node out of the “out actors” pin of the node and finally plug the output pin of the Get node into the object pin of your Cast To node.

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 27, 2024, 11:10am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/10 "2024-09-27T11:10:20Z")

</div>

it still wont work or im doing wrong can you check for me?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/a/63a4c17b27afd3bff867b3561c5ff8dac878a060.png)

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 27, 2024, 11:11am UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/11 "2024-09-27T11:11:53Z")

</div>

You need to plug in the execution pins of the Get All Actors of Class node 😁

The input execution pin to the On See event and the output execution pin to the Cast To node. Also just choose the enemy blueprint itself instead of the base one.

---

<div class="post-metadata">

**Author:** ![DanTDC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanTDC](https://forums.unrealengine.com/u/DanTDC)\
**Post date:** [September 28, 2024, 7:05pm UTC](https://forums.unrealengine.com/t/asking-for-help-for-casting-into-ai-controlled-pawn/2039412/13 "2024-09-28T19:05:24Z")

</div>

Thank you Vis Agilis i found the solution based on your suggestions. I just need to get a check and i use the wrong cast.
