# How can I change the visibility or opacity of a widget using blueprints.

**URL:** <https://forums.unrealengine.com/t/how-can-i-change-the-visibility-or-opacity-of-a-widget-using-blueprints/2039448>\
**Category:** Blueprint\
**Tags:** crosshair, visibility, opacity, unreal-engine, Widget, Blueprint, question\
**Created:** [September 26, 2024, 1:48pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-visibility-or-opacity-of-a-widget-using-blueprints/2039448 "2024-09-26T13:48:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guydzak1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guydzak1](https://forums.unrealengine.com/u/Guydzak1)\
**Post date:** [September 26, 2024, 1:48pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-visibility-or-opacity-of-a-widget-using-blueprints/2039448/1 "2024-09-26T13:48:58Z")

</div>

In my first-person game, I’m currently using a line trace so that the player can pick up objects in the scene. I’ve also got a widget that acts as a crosshair for picking up objects. Next, I would like to use a line trace so that the widget is only visible when the player is looking at an object. I’m having trouble with this step. Do you have any ideas?

 ![Screenshot 2024-09-26 153203](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/9/019d42b2c859d9d1a344362fe1b8fabfed8eb0d8.png)  
 ![Screenshot 2024-09-26 153248](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/d/38d1dceeaf00a402fa26ca8a5ef7f0d486b6810c.png)

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [September 26, 2024, 1:55pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-visibility-or-opacity-of-a-widget-using-blueprints/2039448/2 "2024-09-26T13:55:40Z")

</div>

You can use the “Set Visibility” node for visibility and the “Set Opacity” node for opacity.
