Hi, I’m pretty new to unreal so this question is probably dumb but I’m trying to figure out how to make it so when I click on an actor ingame, it sets a canvas panel visible, which is in a widget blueprint that I made as my hud. I thought the best way of doing that was in the actor blueprint, I put “event actor on clicked” and then “set visibility” (the widget visibility) and for target I put the canvas panel that I want to be set visible. The problem is that the “get canvas panel” needs a target, and I can’t seem to figure out what to put in that “target” node. Is that the best way to do it? If so what do I put as target? Any help would be greatly appreciated. Also I’m using ue5 with blueprints, but I’m pretty sure ue4 has the same logic.
You need to store a reference to the widget in some place that is accesible from the actor.
For example, in the following picture, the widget is created in the Player Controller and stored in a variable called CustomWidget.
After that, you can access the widget from the actor like this:
Thanks for the response, but for some reason it won’t change visibility when I do that, I used a print string to test if clicking works and it does, so I don’t know what the issue could be. Maybe there’s something not letting it do that, I don’t know what could be doing that though. Is there any other way to do that?
It is working fine on my end. Could you check that you are not creating the widget twice somehow? It is the only explanation that comes to my mind, that only one of the widgets is becoming hidden while the other remains visible.
Yes that was it, thanks for the help