# Creating and removing crosshair

**URL:** <https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973>\
**Category:** UI\
**Tags:** unreal-engine\
**Created:** [August 22, 2023, 4:37pm UTC](https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973 "2023-08-22T16:37:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mmm4765](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mmm4765](https://forums.unrealengine.com/u/Mmm4765)\
**Post date:** [August 22, 2023, 4:37pm UTC](https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973/1 "2023-08-22T16:37:20Z")

</div>

Hello, i have a create crosshair widget blueprint set up if my character is not unarmed.  
im trying to set it up so if i drop a weapon the widget removes from parent but for some reason that line of the code doesnt seem to work.

any advise or suggestions are greatly appreciated.

here is my coding.

> **[Crosshair display and remove posted by anonymous | blueprintUE | PasteBin For...](https://blueprintue.com/blueprint/o3os62r8/)**
>
> No description provided

---

<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:** [August 22, 2023, 4:51pm UTC](https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973/2 "2023-08-22T16:51:52Z")

</div>

Event Tick fires every frame. You’re creating 60 crosshair widgets a second. Create it once, on Begin Play perhaps. And then hide when the player becomes unarmed. Do not use Tick for this.

---

<div class="post-metadata">

**Author:** ![Mmm4765](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mmm4765](https://forums.unrealengine.com/u/Mmm4765)\
**Post date:** [August 22, 2023, 5:00pm UTC](https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973/3 "2023-08-22T17:00:06Z")

</div>

that was my intention but the code doesnt seem to work on event begin play, only event tick.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [August 22, 2023, 5:02pm UTC](https://forums.unrealengine.com/t/creating-and-removing-crosshair/1268973/4 "2023-08-22T17:02:56Z")

</div>

when the weapon is equipped, call an event dispatch called something like “WeaponEquipChange”. Give it a bool as the signature and make it true.

when weapon is dropped, call the same event dispatch and make the bool false. Now this one event informs anybody else that wants to know when a weapon is equipped or dropped.

in the blueprint where you handle UI stuff, bind to this event. When the bool is true, create the widget. When the bool is false, destroy or hide the widget.
