# How to make AI and Human character share the same parent BP?

**URL:** <https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887>\
**Category:** AI\
**Tags:** controller, unreal-engine, question, Blueprint\
**Created:** [July 11, 2015, 5:49pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887 "2015-07-11T17:49:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davek](https://forums.unrealengine.com/u/davek)\
**Post date:** [July 11, 2015, 5:49pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887/1 "2015-07-11T17:49:03Z")

</div>

For obvious reasons I’d like my AI characters have the exact same array of features that the human character benefits from. This asks for a common BP parent, which isn’t a big deal…

…however, how do I make AI controller use for example the weapon pickup feature that is normally bound to a keypress of the human player ? ( I’d isolate the functionality into a function but how to call that function at an appropriate moment from within AI controller ? )

Generally, how does one transfer the responsibilities of the human player onto AI controller ? I’m only just beginning to delve into AI, sorry if this sounds stupid easy.

---

<div class="post-metadata">

**Author:** ![davek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davek](https://forums.unrealengine.com/u/davek)\
**Post date:** [July 15, 2015, 7:54pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887/2 "2015-07-15T19:54:15Z")

</div>

Dare I bump ?

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [July 17, 2015, 9:56pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887/3 "2015-07-17T21:56:33Z")

</div>

Your question is a bit vague, it’s not clear what problem, if any, you are trying to solve.

Basically, as you say it is feasible for the most part to use the same `ACharacter`-derived class for PCs and NPCs. Your character will have a set of actions/functions which it is able to perform, regardless of whether a human player initiates them (input handled through the `APlayerController`) or an AI does so.

My general approach is this:

- Have functionality related to _what_ a character can do in the `ACharacter` class.
- Have any complex logic for _how_ an AI-controlled character should go about doing these actions reside in methods of the `AAIController` class.
- Put the higher level logic of choosing _which_ behavior to do and _when_ in the behavior tree.

Taking the weapon pickup example.  
Your character class may have a `PickupWeapon` function, which requires the character to be next to and facing a weapon, and then adds it to the character’s inventory.  
Your AI controller class has the built-in `MoveTo` functionality, but may add a function to smoothly rotate the player to face the weapon.  
Your behavior tree is responsible for deciding at any given time, should the character go and pick up a weapon (if so, request a `MoveTo` followed by a `RotateToFace` from the controller), or should it do some other behavior.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_210761221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_210761221](https://forums.unrealengine.com/u/anonymous_user_210761221)\
**Post date:** [July 11, 2018, 6:07pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-and-human-character-share-the-same-parent-bp/324887/4 "2018-07-11T18:07:17Z")

</div>

What he may be asking is how to give the ai an inventory to be able to pick up items. This is the same issue I am having. I am trying to provide an ai with an inventory system that is accessible by the player, but I am having lots of problems.
