# How to draw a clickable 2d rectangle in the foreground attached to 3d object?

**URL:** <https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909>\
**Category:** UI\
**Tags:** screen-space, unreal-engine, pickups, Widget, Blueprint, question, UMG\
**Created:** [July 8, 2019, 6:15pm UTC](https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909 "2019-07-08T18:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anyamaryina](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anyamaryina/32/88710_2.png) [@anyamaryina](https://forums.unrealengine.com/u/anyamaryina)\
**Post date:** [July 8, 2019, 6:15pm UTC](https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909/1 "2019-07-08T18:15:37Z")

</div>

Hello everyone!

**Problem:** I have a level where 3d objects are falling from the sky and the player have to pick them up by clicking. The camera is static, player can’t manage it. The problem is that sometimes 3d object fall behind, let’s say, a bush and player can’t pick it up because he clicks on the bush but not on the object.

**Goal:** I want to create a transparent 2d rectangle that always will be on the foreground (just like UI elements) and attach it to every fell 3d object so that a player can click on it.

**What i already did:** I tried to do it by widgets but it can be either attached to some object or to be on the foreground. Maybe i just didn’t found out how to make it work correct for me.

**Question:** So what is the best way to rich the goal or to solve this problem?

---

<div class="post-metadata">

**Author:** ![IndieGameCove](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IndieGameCove](https://forums.unrealengine.com/u/IndieGameCove)\
**Post date:** [July 9, 2019, 1:29am UTC](https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909/2 "2019-07-09T01:29:15Z")

</div>

you’re probably using the ‘get hit result under cursor’ node somewhere to select stuff that uses the visibility channel by default.  
you could change the collision setting of the bushes so they don’t respond to the visibility trace channel, or you could create a new collision channel specifically for the falling objects.

---

<div class="post-metadata">

**Author:** ![anyamaryina](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anyamaryina/32/88710_2.png) [@anyamaryina](https://forums.unrealengine.com/u/anyamaryina)\
**Post date:** [July 9, 2019, 3:42pm UTC](https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909/3 "2019-07-09T15:42:55Z")

</div>

thank you for the aswer!  
no, i’m not using any hit nodes… objects are falling because of enabled gravity and i pick them up by using “onclicked” node. does changing collision settings can really help in this case?

---

<div class="post-metadata">

**Author:** ![anyamaryina](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anyamaryina/32/88710_2.png) [@anyamaryina](https://forums.unrealengine.com/u/anyamaryina)\
**Post date:** [July 10, 2019, 10:38am UTC](https://forums.unrealengine.com/t/how-to-draw-a-clickable-2d-rectangle-in-the-foreground-attached-to-3d-object/451909/4 "2019-07-10T10:38:14Z")

</div>

Just solved this by changing collision presets (Details → Collision → Collision Presets) of every bush/grass/flower on the scene from ‘Default’ to ‘Invisible Wall’.
