Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [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)

    Click image for larger version  Name:	Untitled.jpg Views:	14 Size:	385.7 KB ID:	1731584

    Last edited by Karrelen; 03-11-2020, 05:34 PM.

    #2
    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.
    DownToCode Website

    VR Debug Plugin - Debug your VR game/application inside VR

    Email Plugin - Send emails from one email address to another.

    FREE VR Content Examples - A bunch of VR examples to get you started and for free.

    Comment


      #3
      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 ;-)

      Originally posted by DownToCode View Post
      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
      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)

      Click image for larger version  Name:	Untitled2.jpg Views:	0 Size:	259.9 KB ID:	1731744





      Last edited by Karrelen; 03-12-2020, 09:12 AM.

      Comment


        #4
        Karrelen happy to see you got it working. Keep it up
        DownToCode Website

        VR Debug Plugin - Debug your VR game/application inside VR

        Email Plugin - Send emails from one email address to another.

        FREE VR Content Examples - A bunch of VR examples to get you started and for free.

        Comment

        Working...
        X