# Print variables from NPC Blueprint

**URL:** <https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023>\
**Category:** Blueprint\
**Tags:** debug, unreal-engine, question\
**Created:** [December 12, 2017, 2:18am UTC](https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023 "2017-12-12T02:18:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbleMabel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AbleMabel](https://forums.unrealengine.com/u/AbleMabel)\
**Post date:** [December 12, 2017, 2:18am UTC](https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023/1 "2017-12-12T02:18:09Z")

</div>

I’ve been searching the Internet and trialing things for hours and I’m getting fed up now! I am building an idle state random dialogue system for an NPC. I’d like to be able to debug as I go but I cannot figure out how to set it up so I can press various keys to print variables from the NPC BP.

Obviously setting up a simple key press Print of a variable in the NPC’s BP doesn’t return any results as when I play the game, I’m not the NPC when pressing the required key… help!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 12, 2017, 9:01am UTC](https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023/2 "2017-12-12T09:01:06Z")

</div>

Set up a CustomEvent that prints text in the NPC. During gameplay: get NPC \> fire that custom Event

For something more advanced, have a debug widget in the NPC that follows it around and shows its state.

---

<div class="post-metadata">

**Author:** ![AbleMabel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AbleMabel](https://forums.unrealengine.com/u/AbleMabel)\
**Post date:** [December 12, 2017, 9:46am UTC](https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023/3 "2017-12-12T09:46:33Z")

</div>

Thanks for the response! I’m not quite sure I understand how to implement that first suggestion.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 12, 2017, 10:03am UTC](https://forums.unrealengine.com/t/print-variables-from-npc-blueprint/412023/4 "2017-12-12T10:03:46Z")

</div>

Open the NPC blueprint and create a CustomEvent, make it Print the variable you want.  
When you approach the NPC in game, get its reference (by clicking/collision - a method of choice - however you _select_ which NPC to interact with) and trigger the CustomEvent.
