Announcement

Collapse
No announcement yet.

[VIVE] VRPawn start location independent from HMD location in room setup.

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

    [VIVE] VRPawn start location independent from HMD location in room setup.

    Hello,

    I am struggling to make VR pawn camera (from VR template) to be at exact same place every time when i set world location for it or for VROrigin scene component no matter where my HMD is in the room space.

    What i am trying to do is on BeginPlay to set world location for VRorigin or camera ( i tried for both and the result is same) and get HMD orientation and position> break vector from it then make vector and subtract it from world location of the placeholder object where i want player to be spawned or teleported every time at begin play for example.

    The problem is that i always get strange offset because my hmd is not at the center of the room setup. Is it possible to set the location of the camera every time at exact same location no matter where my HMD is positioned in room setup? Because i need more precise spawn in tiny place, and sometimes i get spawned in a wall for example or far away from actual spawn location.

    Can you guys can explain to me how to do it more in details, please.

    Regards!

    #2
    Hi, can you show your Blueprint with your spawning logic and re-positioning? That may be a good starting point to try to solve your issue.
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Hello,
      and thank you for the reply!

      Basically this is my setup for VRPawn its not exactly a spawn point its something like set player start location when i run the project in VR. Or teleport the player camera at some coordinates.

      Since i cant upload a image for some reason i provide you a link to my setup : Link
      I saw this code from bp_motion controller since always teleport the camera at the exact location where i am pointing at with the arch no matter where the HMD is in the room space.

      SpawnLocationPlaceholderObject is reference to other blueprint which acts like placeholder in the world just to get the desired world coordinates so i can place the Player camera at exact these coordinates on beginplay. The problem is that if HMD is not at the center of room setup i always get unpredictable offset from the object placeholder location.

      For example if you place the VRPawn somewhere in the level, for example you want to spawn at the center of a cube and then you start the game and your HMD is somewhere in the room setup not exactly at the center you will end up with some random offset position for the camera, you wont be in the middle of that cube like you place the VRpawn in the editor.

      Regards!




      Comment


        #4
        Is the Spawn Location Placeholder Object set to Z=0? You seem to disregard the Z position of the HMD but not of the target placeholder. Any reasons you are using Get Position and Rotation instead of working directly with the position of the VR Camera? Last but not least, where is the original code in the MotionControllerPawn which sets the Tracking Origin?
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          Thanks for the reply

          The spawn location placeholder object Z is not equal to 0 and i think it will never be because i place it somewhere randomly in the level.

          The reason i am using Get Position and rotation for HMD is because if i am not wrong this is how teleport place the VRCamera exactly at the position you are pointing at with the teleport arc, no matter where my HMD is in room space.

          The original code is in Bp_motionController and its a function called "GetTeleportDestination"

          Regards!

          Comment


            #6
            I have the same problem, Is there a solution for this?

            Comment

            Working...
            X