# trying to have a widget hover over an actor and display text depending on the blueprint variables

**URL:** <https://forums.unrealengine.com/t/trying-to-have-a-widget-hover-over-an-actor-and-display-text-depending-on-the-blueprint-variables/480079>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question, actor-class\
**Created:** [March 10, 2021, 9:44pm UTC](https://forums.unrealengine.com/t/trying-to-have-a-widget-hover-over-an-actor-and-display-text-depending-on-the-blueprint-variables/480079 "2021-03-10T21:44:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avenger465](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Avenger465](https://forums.unrealengine.com/u/Avenger465)\
**Post date:** [March 10, 2021, 9:44pm UTC](https://forums.unrealengine.com/t/trying-to-have-a-widget-hover-over-an-actor-and-display-text-depending-on-the-blueprint-variables/480079/1 "2021-03-10T21:44:40Z")

</div>

Hello,

I have created a widget class that I want to update what is shown depending on the blueprint it is attached to.

.cpp file in the constructor, I have created a TSubclassOf for the WidgetClass in the header file

```
	ConstructorHelpers::FClassFinder<UPickupInfo> WidgetClassFinder(TEXT("/Game/Blueprints/Widgets/WBP_PickupInfo"));
	if (WidgetClassFinder.Class != nullptr)
	{
		WidgetClass = WidgetClassFinder.Class;
	}

```

I have tried this in BeginPlay, However it is always empty

```
UPickupInfo* pickup = Cast<UPickupInfo>(WidgetClass);
```
