[SOLVED] VR widget BP and Level BP communication with event dispatcher issue

Hello Virtual Creators,

Thanks to the community, I understood that for communicating between widget BP and level BP you need the event dispatchers (instead of interface BP).

But in VR I can’t make it works. Here, the idea is that if the player click on an interface icon with its controller it will have the effect “morning” on the map.

But nothing happened… the function is called and binded ok but the event node “morning” is not fired… a hint towards the right direction will be nice!

Note that the widget component is a child of the camera of the motioncontrollerpawn (so the inferface appear in front of the player’s view)

As far as I can tell by looking at the screenshot, the dispatcher you are binding is on the wrong widget. You have a MotionControllerPawn with a camera in it and attached to the camera you have a widget. In the level blueprint, however, you create a completely new widget which isn’t the one that is inside the MotionControllerPawn and bind to the event of that widget. The widget you just created in the level blueprint never gets actually used anywhere, as you don’t add it to the viewport (since you are in VR) or use it in the MotionControllerPawn Widget Component.

To have that Morning event firing you would have to get a reference to the MotionControllerPawn then get a reference to the Widget Component then get the UserWidget of that component, cast it to the UIVRInGame widget and then bind the event Time_Morning on that widget reference.

Thank you so much DowntoCode!! I understand my mistake and I got the principles you explained.

By the way, I saw your VR tutorial on youtube in the past, it seems quite useful (although I did not understand it all, now hopefully I can :wink:

That is exactly that! You were right.

In case someone has the same issue and for future reference : to get a reference for the widget you right click in your level BP and type “get [name of your widget]” , then you need to create a variable and in type you have to search for your player’s pawn (you could have to search for it in its default value too), then connect the two and proceed like here :
(note that here the Widget BP is called UI_VR_Ingame)

@Karrelen happy to see you got it working. Keep it up :wink:

hi , i have the same problem, but couldn’t apply the solution can you help me with it?