Removing a widget with button press

Ok my good man (or woman), thanks to your PDF I’ve now figured out what I did wrong. It’s super stupid.

I created the variable of the type of the blueprint actor in the actor and not in the widget.

If I create it in the widget, I don’t get errors, and then I also get why the cast is unnecessary.

BUT, sadly, it still does not work, because it is not receiving the variables. I tried with a bool and an int, it’s not working, nothing is happening and the bool doesn’t seem to get updated.

I’ll set something up tomorrow for you to look at, I have enough of this for today.

Thanks for still bearing with me! Without that help I think I would have gone insane by now, lol!

Hey, here’s the project. It’s 60 mb though, but the only important things in there are the bp_texchange actor and the widget, everything is located in “FirstPersonBP”.

I’d really appreciate if you would take a look at it. The questionable code is in the WBP_InteractionUI2 where I try to access the boolean from the actor.

The workaround is also still in there, I just unplugged it, and I commented everything.

My problem really is getting the value of the boolean Ice1 in the WBP_InteractionUI2, which does not work right now.

Maybe you can see why not.

I just had a quick glance at your project, mainly to see where things are and to familiarize myself a little.

The first thing that jumps out at me is a notice saying you are using an experimental class (“Here be dragons!” it tells me.). I hope this isn’t something only I get?!

I didn’t have much time to look at this today and I have a busy day tomorrow as well so I’m not sure when I’ll have an answer for you, but probably sunday evening or monday. If I solve it, that is.

So what I did see from my quick glance was that the problem with Ice1 most likely is the reference but there was no time to look into it any further today.

No, it’s the 3D widget component which is experimental.

I was wondering if the problem was that I can’t open the drop down menu and pick the actor there…I’ll also keep trying stuff, thanks for looking into it and have a nice weekend!

Ok so I tried making it work with the Texchange cube but interacting with a sphere instead of the widget, and it worked, because I could pick the actor in the sphere blueprint. I can even pick it in a normal widget, but not in that widget component widget. The moment I assign it in the component part of the actor blueprint using it, it doesn’t work anymore.

Found this Can not set default value of object reference variable - Programming & Scripting - Unreal Engine Forums

And someone wrote: “You need to get a reference from somewhere else (not a direct reference to the object by default or the level script). This can be achieved by spawning those actors, receiving them via “Get All Actors of Class”, overlap / collision events or by passing down a reference from somewhere else.”

This is exactly what I meant earlier.

I have no idea if there is a good workaround besides just casting to my actor.

Please tell if you get different results, but if not - what do you think is a better solution: Get all actors of class or cast to my player character (the workaround) ?

My weekend has been crazy and I have no energy left to explore your project today.

I wanted to try to set up an event dispatcher to see if that can work. If I can get that up and running you can most likely communicate directly betwren widget and actor blueprints.

But if that does not work you should go for the workaround. Forget Get all actors of class!

I’ll try the event dispatcher sometime tomorrow.

I have not been able to implement the event dispatcher the way I hoped so I think the best solution to this is your workaround.

Thanks so much for trying and helping out! Means a lot to me!

Wish you all the best!

Thanks, the same!