OnComponentEnd Overlap Issue

Trying to show a Widget Popup “On Overlap Begin” which is working, but the Widget is not removed from Player Screen / Viewport when “Overlap End” - any issue with the below (blueprint screenshot attached)?

Overlap is between BP_Character and BP_Building - tried Component Overlap in Event Graph of both (either is not working).

After creating the widget during begin overlap, store the “Return Value” in your Widget variable. This way when you tell it remove itself during end overlap, the variable has a reference to your popup widget.

Hi Stormrage256 - tried storing the Return Value, still didn’t work.

Nevermind - corrected the “Exec” - working fine. Thanks.

Another Related Question - I need the Widget Popup to show different values for each instance of BP_Building added in the Landscape (which will be a public variable defined in BP_Building). How do I add that Variable Input before “Add to Viewport” node here in the “On Component Begin Overlap (Box)” node?

With the current Blueprint screenshot shown above - it will display sample value for all the instances of Building, which I would need to change to a variable. Widget screenshot is attached, which is simple one with just one Text Box.

Hi Srikanth, I don’t have access to my PC right now. So I’m not 100% sure about this, but you can try creating a new “Text” variable in your PopUp widget and set the Instance Editable & Expose on Spawn properties of the variable to True (through the variable details panel).

Normally what this does is expose these variables to be set through the node that creates the object. For example, if you’re using Spawn Actor from Class, then you will see additional input parameters in that node to set these variables at spawn.

I believe the same should apply to the Create Widget node as well and you should see an additional Text input parameter as part of it. If this works, then you can just specify what text to be displayed through it. Then within the PopUp widget, you can take this variable & set it as the text for your Sample Display in its Event Construct.

Hi Stormrage256 - Most of it is working, just not able to link the variable from the Actor (Building, that the Character is Overlapping with) which is creating the Widget and where I’m defining the variable value TO the Event Construct of PopUp widget. How do we get the variable from Building Actor to Widget PopUp’s Event Construct?

1st attachment is the screenshot of the Building BP where Overlap logic is written and Variable is Set / Linked.
2nd attachment is the screenshot of Widget - where the Variable is created that is showing up in Building when creating the widget, but linking the variable from Building is missing (currently just taking the Default value set from the variable within Popup widget)

Alright, when you set the variable through the exposed input parameter in the Create Widget, you’re already assigning the value to Sample Text. So you don’t have to set it again during the Event Construct.

Instead what you’d want to do is take the “Sample Text” variable (which already has the value you passed during Create Widget), and pass it as the input for the Set Text node using your “Sample Display” text block. This way, you’ll be overriding the default value of your text block with the one from Sample Text.

Thanks - am I doing this correct? If yes - how should be the target set here (currently getting error). Sorry for the basic question.

Set Text is a function of the Text Block Widget. So you just have to connect the “Sample Display” text widget to it. But since it is not available as a variable by default, you can mark it as one by setting the tick box shown below to true.

Once you do that, you will see it as a variable above or below the SampleText variable.

Thanks - Syntax worked - but it is not showing the value which was set in Building BP (expecting the value to show as “Passed from Building” which is Default Value of BuildingText Variable in Building BP)

nevermind - somehow Exec link missed in the Overlap nodes as shown in Post #7 above (which was there earlier). It’s working now.

Appreciate all the help - you rock !!

On a different note - can you please check if you can comment on my another post/issue. waiting for help on this for couple of days.
https://forums.unrealengine.com/development-discussion/content-creation/1708723-attaching-player-to-landscape-collision-navigation-issues

Thanks for all your help again !

Glad to hear that it’s working! I was busy with work these last few days. So couldn’t check up on the other post. But from what I see right now, I’m assuming that you’ve already figured out the solution?