Announcement

Collapse
No announcement yet.

Maintain Widget in front of camera in VR

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

    Maintain Widget in front of camera in VR

    Hello mates,

    Just made a simple widget for menu testing ingame in VR . I am trying to maintain the widget in front of the camera but I can't get it, I am missing something, any idea?

    A little help will be nice, Here is the BP :


    Click image for larger version

Name:	Widget_Front_VR.jpg
Views:	154
Size:	217.9 KB
ID:	1719327

    #2
    Have you tried simply adding a WidgetComponent to the HMD camera as a child? It's definitely the simplest approach.

    Comment


      #3
      Originally posted by bsawler View Post
      Have you tried simply adding a WidgetComponent to the HMD camera as a child? It's definitely the simplest approach.
      Yes, you are right, I tried and it works like a charm including interaction. Thank you so much Bsawler :-)

      Now, purely out of curiosity and if anyone have some time to kindly solve this enigma, regarding the BP above, what should I have added to maintain the actor widget (or finally any object/actor) in front of the camera, which nodes are missing? The BP above works partly, the widget does appear and follow me except it appears on my right and not in front of the camera.
      Last edited by Karrelen; 02-10-2020, 08:29 PM.

      Comment


        #4
        Looking at this on a mobile screen so can't sit here and step through it well, but it appears that you're just offsetting the position by a fixed 0,30,-5. But that will only work if you aren't rotating the view. Instead what you should do is offset by the camera's forward vector*30 for instance so it will always be 30 units in front of the camera.And then you want to rotate the INVERSE of the Z rotation for instance, so that it's facing the camera (camera is 45 degrees to the right, object needs to be 45 degrees to the left to be "facing").

        Hopefully that makes sense!

        Comment


          #5
          Originally posted by bsawler View Post
          Looking at this on a mobile screen so can't sit here and step through it well, but it appears that you're just offsetting the position by a fixed 0,30,-5. But that will only work if you aren't rotating the view. Instead what you should do is offset by the camera's forward vector*30 for instance so it will always be 30 units in front of the camera.And then you want to rotate the INVERSE of the Z rotation for instance, so that it's facing the camera (camera is 45 degrees to the right, object needs to be 45 degrees to the left to be "facing").

          Hopefully that makes sense!
          Thanks BSawler, I will try that and come back here for talking about the results.

          Comment


            #6
            what bsawler said is spot on, As my Issue is exactly that!, I didn't like having the menu stuck in front of the VR players face
            I want to FIRST get where the player Is Looking in VR, then Spawn the widget there. and leave it there until the player closes the menu and reopens it again.
            http://www.unrealengine.com/marketpl...rtual-grenades
            https://www.artstation.com/alphawolf
            https://www.youtube.com/user/AlphaWoIFuk/videos

            Comment

            Working...
            X