So I have a bunch of Actor bp’s in my level that are spawned from one master bp, each actor has different tags depending on what it does. I have a widget that has items like a checklist, with an image of a checkmark in each of the boxes set to hidden, so when the player interacts with an object, if it has a tag, the checkmark in the widget becomes visible so it looks like they just checked it off as they interacted with it.
My problem has been, the only way I can kind of get it to work is after a “ Actor has tag” branch check in the master object bp, create the widget and do the checkmark un hidden functionality there.
However I have tab set up to Create/remove from parent the widget in the player, and since the bp is calling a new instance of the widget in the master actor and doing the logic there, it’s not showing up on the character widget when they call it.
So how Could I code it so that when the player interacts with the actor, it sets the checkmark to visible in the players widget?
i personally would not recommend to interact directly with the ui. but instead use a manager to control the ui and communicate with it. that way you avoid having extra code in the widget, and can expand to more complex code. might be safer in the future.
i cant see the rest of the code but you cant call the event before the widget exists, so just change the order of operations.
your widget should be persistent anyway, you dont want to create/destroy it everytime the event is called or you will lose the previous state. just set it visible/hidden if you prefer and create it on the player controller on begin play
That was another problem I was having I created it on begin play and made it hidden, then changed it to visible on my tab push event, but it just would not change the visibility no matter what I did, So idk, this is the only way it’s working for right now.
i cant see a problem with the visibility but until you get it working you should be validating your references for now just use a print string, so for instance you can rightclick on your JournalWidget and ConvertToValidatdeGet and then on fail printstring something useful. you should likely do this everywhere, ie castfailed etc.
this will help pinpoint problems.
if the event doesnt work its likely that the Call happened before the Bind, this is hard to debug so you just have to be careful.
just to clarify though since you didnt show it but dont forget to
once you get it working you can add input pins to the EventDispatcher, so for instance you can pass through the ActorTag so the widget knows what to update.
unfortunately i’m heading out now but you’re on the right track. good luck.