Good, your widget is working. Now, your issue is on your level blueprint, and that casting was incorrect.
Footage of what I actually have
My level Bp:
At the start of the game i get âdisp apresâ, so it goes through the âbind eventâ node
btw idk why i should âcreateâ the widget because it is already a placed actor in the level
Youâve figured that out. Your widget is a component of an existing actor in the level. So, you need to retrieve the widget reference from that actor and bind the event dispatcher from it.
with a cast ?
sorry If I ask dumb questions, Its been only 2 weeks I am working with UE5 and english isnât my native language
how am I suppose to do that ?
Click on that actor while in editor, and go the level blueprint and right click, and you should see something like âcreate a reference to âŚâ
Then, get component by class, select widget interaction component and bind event to your test dispatcher. Connect to your level bp begin play.
forgot about that, sorry.
but with this reference it looks like i canât bind it to the event dispatcher
edit: doesnât work with âwidget componementâ either
In this case, you need to cast. From get component by class, cast to your IWB_⌠and try again.
Youâre almost there.
Let me search how to proper reference a widget interaction and Iâll share here.
thank you very much for helping me
Hi there,
I am not sure how to reference an interaction widget, perhaps you should experiment with these nodes below. Also, you may need to change the parent class of your widget, from UserWidget to InteractionWidget.
If that doesnât work, you may want to revert your widget to user widget and go from there. This is how you want to reference a User Widget
Unfortunately, I canât find a documented way to reference this type of interaction widget. Letâs see what other devs would recommend.
I do not have the option âcast to interactionWidgetâ, and when I try to change the parent of my widget I do not have the option to change to a InteractionWidget
For the second Image are you in level BP ? I canât get the reference of my Widget
I found out the solution. You just have to create a Game Mode with a event Dispatcher and use âget game modeâ > âcast to (your GM)â and then call or bind your event
you can also make a variable and set itâs type to WIDGET>OBJECT reference. and connect.
should work just fine