# Casting to Enemy in Service of Behaviour Tree

**URL:** <https://forums.unrealengine.com/t/casting-to-enemy-in-service-of-behaviour-tree/456131>\
**Category:** Blueprint\
**Tags:** casting, cast-failed, service, behaviour-tree, unreal-engine, Blueprint, question\
**Created:** [September 28, 2019, 8:19am UTC](https://forums.unrealengine.com/t/casting-to-enemy-in-service-of-behaviour-tree/456131 "2019-09-28T08:19:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FishOmelette](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishOmelette](https://forums.unrealengine.com/u/FishOmelette)\
**Post date:** [September 28, 2019, 8:19am UTC](https://forums.unrealengine.com/t/casting-to-enemy-in-service-of-behaviour-tree/456131/1 "2019-09-28T08:19:35Z")

</div>

Hi, I’m having trouble with casting to an Enemy in the Service of its Behaviour Tree. I have other similar Services within the same Behaviour Tree but for some reason, this cast keeps failing although no error shows up. Any suggestions as to why this might be the case? I tried changing the “Event Receive Activation” to “Event Receive Activation AI” but it doesn’t seem to have much of a difference either. I have included some screenshots of the Behaviour Tree and the failed casting. Thanks!!

 ![288633-onscreencastfail.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/0/bd066952634f9aec6f668b9b628525cc988a7634.png)

 ![288630-onscreencastfail-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/c/b5c96b6ce7d136e24f3b26ab3180ffb81e70ad3b.png)

---

<div class="post-metadata">

**Author:** ![weberl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@weberl](https://forums.unrealengine.com/u/weberl)\
**Post date:** [September 28, 2019, 1:24pm UTC](https://forums.unrealengine.com/t/casting-to-enemy-in-service-of-behaviour-tree/456131/2 "2019-09-28T13:24:10Z")

</div>

Can you add a Breakpoint to the cast (“F9”) and when the execution stops, hover over the input. Then you should see what class the parameter has you get there.
