I am making a prompt appear when you enter a collision box and when you leave the collision it removes it. So my problem is that when I enter the collision box it opens the widget but when I leave the collision I doesn’t remove the widget. I tried this in 4 different ways but I was never able to remove the widget.
Here are the ways i tried it:
1.
2.
3.
4.
Thank you in advance
1 is the answer.
It works for me.
2 is also fine, but 1 is enough.
3 and 4 would be fine if you cast to your player.
1 Like
I guess then I have a glitch or something because it doesn’t work for me
here I use 1 but the widget doesn’t get removed after I get out of the box. And its the same outcome with all options I tried
I think you’re still overlapping, can you try just backing out again?
no… 1 isn’t the answer… since you can’t make sure the Widget Reference of the Create Widget Node keeps being valid over time… 2 is the only way to keep the widgets ref!
With 1 it can happen, that the ref gets invalid over a really short amount of time and the remove from parent gets a nullptr…
same principle if you don’t add a UPROPERTY to a variable in cpp, it gets garbage collected
1 Like
I figured it out I had the capsule activate overlap events so I guess when the capsule and the static mash simultaneously did the overlap they caused it to glitch
1 Like