# Static mesh not destroyed on keypress

**URL:** <https://forums.unrealengine.com/t/static-mesh-not-destroyed-on-keypress/407387>\
**Category:** World Creation\
**Tags:** Destroy, destroying-actors, unreal-engine, UE4, Blueprint, question\
**Created:** [October 19, 2017, 9:10am UTC](https://forums.unrealengine.com/t/static-mesh-not-destroyed-on-keypress/407387 "2017-10-19T09:10:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethranes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ethranes](https://forums.unrealengine.com/u/ethranes)\
**Post date:** [October 19, 2017, 9:10am UTC](https://forums.unrealengine.com/t/static-mesh-not-destroyed-on-keypress/407387/1 "2017-10-19T09:10:27Z")

</div>

Hi, I am building a system where when a player character is within a certain distance from a static mesh and clicks a key, the mesh is destoryed and the item goes into the players inventory. I am able to “pickup” the item and have it appear in my inventory, but the static mesh is not being destoryed as I expect it to. I have attached my event graph and the functions for this implementation.

 ![217174-evntgra.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/3/793588ccd6b886ac29d4706c2f362e0a6d418a21.jpeg)

 ![217175-linetrace.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/9/7a910fbb3bd82f763d9815a0a46a5fc3ad02791b.jpeg)

 ![217176-additem.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/c/9dccd796a05e4178d390ca5de48ca03bcd55b27e.jpeg)

 ![217177-destroyitem.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/6/fe6209380a1239ad6adfa0f4770f05d7edcdccc5.jpeg)

Any help or advice is appreciated, let me know if more information is needed, I’m new to Unreal Engine. Thanks.

---

<div class="post-metadata">

**Author:** ![ethranes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ethranes](https://forums.unrealengine.com/u/ethranes)\
**Post date:** [October 19, 2017, 12:43pm UTC](https://forums.unrealengine.com/t/static-mesh-not-destroyed-on-keypress/407387/2 "2017-10-19T12:43:38Z")

</div>

UPDATE: This issue only happens when I run on dedicated server, if I disable the dedicated server the actor is destoryed as expected. So I assume that I need to replicate something for this destory to work when running on a server.

---

<div class="post-metadata">

**Author:** ![Iotti](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Iotti](https://forums.unrealengine.com/u/Iotti)\
**Post date:** [October 19, 2017, 1:09pm UTC](https://forums.unrealengine.com/t/static-mesh-not-destroyed-on-keypress/407387/3 "2017-10-19T13:09:02Z")

</div>

Did you try to create a destroy event on item and calling it from the client after Add Item instead of Destroy Actor?
