I have the current blueprint for dialogue to fire on a collision but this only happens once, I would like to make this repeatable, so that anytime the player isn’t already in the dialogue widget, it should still be able to activate after the first time.
Currently the player walks into the NPC trigger area for the chat widget, I press ‘E’ and it activates and works great. As soon as I click the ‘Leave’ button within that widget, I’m not able to see the widget again after pressing ‘E’ again, yet I can hear the chat noise from that blueprint.
You remove it from the viewport so it needs readding. On isValid check if the widget is in viewport, if no, add it. The check is necesary, otherwise the editor will complain we’re adding it more than once.
It’s already created and referenced, it just does not have a parent to latch onto.
I’ve assumed the Leave button removes it in a simialar fashion as shown above when we run out of dialogue lines.
Great! I have that working now thank you. Secondary issue now, the dialogue runs through the different text each time I leave and activate it again. Once it finishes the text it starts again.
E key pressed for the first time, first dialogue text appears, I then click Leave.
I am assuming you have two ways of ending that chat. Either we run out of stuff to talk about or we press Leave. Am I correct? How is it supposed to work?
E key pressed for the first time, first dialogue text appears, I then click Leave.
E key pressed for a second time, second dialogue text appears, I then click Leave.
That’s not what you want, right? You want to restart? Or is this fine?
E key pressed for a third time, empty dialogue appears, I then click Leave.
What does Leave really do? Perhaps the index needs resetting? If so, it’s a perfect opportunity for an event dispatcher.
Clicking the leave button would execute the script at the bottom and reset the index. You’d also no longer need to remove all widgets inside the dialogue.
The Get All does not do anything here atm:
And the Remove All may be redundant unless you really must remove the ENTIRE game interface. As a side note, widgets are happy to remove themselves from any container they’re in: