Announcement

Collapse
No announcement yet.

Help! How do I decouple hands from HMD rotation in Epic's FPS template?

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

    Help! How do I decouple hands from HMD rotation in Epic's FPS template?

    I'm using the FPS Template in VR to find my feet with development with my Oculus headset and Touch controllers. However, I have stumbled into an issue immediately. The VR hands and gun provided with the FPS template have their relative position and rotation locked to the HMD so that if I turn my head, the guns will move & rotate with them. They still have offsets that take into account hand movement, which is similar to how PSVR titles track Dual Shock 4 movement, but it's not suitable for Touch. Vive & Move development.

    Does anyone have any idea how to unlock the hands from the head? Do I need to create a new BP, separate from the player pawn, just for the hands?

    Also, at the moment I'm manually hiding the standard gun & arms and making the VR hands visible because the initial 'Is Head Mounted DIsplay Enabled' check doesn't seem to register that UE4 is running fine on my Oculus. Is this expected? Or is there a project setting I'm missing somewhere to force this on?
    Last edited by Jimmy_Jazz; 11-15-2017, 09:32 AM.

    #2
    If you want to enable the use of Motion Controllers in the FPS Template, all you have to do is to _manually_ set the Use Motion Controllers? boolean variable inside the First Person Character blueprint to True. That will cause the body attached arms + weapon to be replaced by the standalone weapon attached to the Right motion controller.
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      I can already do that. The problem is that with the FPS Template, if you turn your head, your motion controller world positions and rotations are moved and rotated too. They're using local offsets relative to the camera.

      I suspect the solution is to take the controllers out of the player pawn's, create hand controller BPs and spawn them on play, which is how the Motion Controller template currently does it.

      Comment


        #4
        Apologies but I don't follow your reasoning.

        In the standard FPS template the Motion Controller components are _not_ parented to the FirstPersonCamera, they are at the same level. Both are parented to the root component, which is the collision capsule.

        What is parented to the FirstPersonCamera and therefore moves with it is Mesh2P, but that one is hidden when Using Motion Controllers? is set to True. Also, when Using Motion Controllers? is set to True, the VR_Gun, parented to the right motion controller, is displayed.

        Are we looking at the same template or not?
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          First things first, screw the FPS template for VR. You're going to spend a lot of time reinventing the wheel. I'd HIGHLY recommend starting with Mordentral's VR Expansion Plugin example instead. It has everything you could possibly want and more out of the box.

          Official thread: https://forums.unrealengine.com/deve...pansion-plugin

          Comment


            #6
            Originally posted by SlimeQ View Post
            First things first, screw the FPS template for VR. You're going to spend a lot of time reinventing the wheel. I'd HIGHLY recommend starting with Mordentral's VR Expansion Plugin example instead. It has everything you could possibly want and more out of the box.

            Official thread: https://forums.unrealengine.com/deve...pansion-plugin
            I would say it depends on what the objective is. Mordentral's plugin is great to quickly get you to production and does a lot of the heavy lifting for you. On the other hand, if one wants to learn the basics of how VR works in UE4, using a plugin (any plugin) may not be the best option for the exact same reasons.

            The FPS template contains a very basic VR setup, but it is largely incomplete. The standard VR template is definitely a much better choice to get started.
            CTO | Head of VR Development - Visit us at http://humanxr.com
            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

            Comment


              #7
              Originally posted by vr_marco View Post

              I would say it depends on what the objective is. Mordentral's plugin is great to quickly get you to production and does a lot of the heavy lifting for you. On the other hand, if one wants to learn the basics of how VR works in UE4, using a plugin (any plugin) may not be the best option for the exact same reasons.

              The FPS template contains a very basic VR setup, but it is largely incomplete. The standard VR template is definitely a much better choice to get started.
              Yeah I would argue that my plugin and template are actually pretty bad for complete beginners, they would likely be overwhelming.

              However I'll note that the plugin isn't intended to "get into production" It simply does some things that straight up aren't possible in blueprints only and some things that are fairly difficult even in c++.


              Consider supporting me on patreon

              My Open source tools and plugins
              Advanced Sessions Plugin
              VR Expansion Plugin

              Comment


                #8
                mordentral You are too humble!
                CTO | Head of VR Development - Visit us at http://humanxr.com
                My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                Comment


                  #9
                  I spent around 2 months (as a beginner) trying to hack VR hands and proper VR character movement into some combination of the FPS and VR templates, only to find that mordentral had done those things far better in the plugin. I learned 100x more from digging through the plugin code than I did during those 2 months of tinkering. I suppose it is a bit daunting, however.

                  Issues like this one however are pretty silly to worry about when they've already been solved. I remember having issue after issue like this starting out and really none of them ended up being things I needed to worry about. HMD facing the wrong way, height being wrong, hand motions being rotated, mouse affecting rotation, capsule positioning, jittering, collision issues, etc etc.

                  The basic VR template is definitely better than the FPS template though. So again, screw the FPS template. It uses a pawn instead of a character however. I'm assuming OP wants to use a character since they're trying to use the FPS template, in which case the expansion plugin template will be much more useful.
                  Last edited by SlimeQ; 11-21-2017, 05:09 PM.

                  Comment


                    #10
                    Originally posted by vr_marco View Post
                    Apologies but I don't follow your reasoning.

                    In the standard FPS template the Motion Controller components are _not_ parented to the FirstPersonCamera, they are at the same level. Both are parented to the root component, which is the collision capsule.
                    Apologies, I misread the tree. However, that still doesn't solve the actual issue at hand: How to decouple motion controller position and rotation from the HMD in the FPS template.

                    As SlimeQ says, the VR template also handles movement different from the FPS template. I was hoping to avoid Code Plugins and do everything in Blueprints, but may give the Plugin a shot next week.

                    Also, the FPS Template fires projectiles from your head when using Motion Controllers as well, naughty Epic!




                    Comment


                      #11
                      I really struggle to match your experience with the FPS template to the one I am having. Not sure where the problem is, but in my case the controllers are not "coupled" to the HMD and there is no firing from the head. The firing happens from the weapon held in the right hand (right motion controller). Go figure!
                      CTO | Head of VR Development - Visit us at http://humanxr.com
                      My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                      Comment


                        #12
                        Oh, i think I might know what's going on. In fps template capsule rotation follows camera (I think) so if controllers are parented to it you'll have weirdness. This is a shot in the dark.

                        Originally posted by Jimmy_Jazz View Post

                        As SlimeQ says, the VR template also handles movement different from the FPS template. I was hoping to avoid Code Plugins and do everything in Blueprints, but may give the Plugin a shot next week.
                        You will soon find that your collision capsule is locked to the center of your play space and fixing that in blueprint will perform horribly. Probably not worth the effort.

                        The shooting from the head thing is pretty weird though, I suspect you may have broken something. Try starting with a fresh template and just changing the bUseMotionControls boolean

                        Comment


                          #13
                          Jimmy_Jazz I am currently experiencing the exact same problem when using the FPS template for VR. When moving the HMD the motion controllers also move. Did you or has anyone found a simple solution to for this within the FPS template? SlimeQ I think you are correct with regards to the capsule.

                          Comment


                            #14
                            Originally posted by Speedy-P View Post
                            Jimmy_Jazz I am currently experiencing the exact same problem when using the FPS template for VR. When moving the HMD the motion controllers also move. Did you or has anyone found a simple solution to for this within the FPS template? SlimeQ I think you are correct with regards to the capsule.

                            The FPS template does _not_ use the Motion Controller (right one) unless you edit the FirstPersonCharacter Blueprint and set the UsingMotionControllers? variable to True. If you don't do so, the FPS template simply uses the gun mesh parented to the HMD, which may give the impression the Motion Controller move with the HMD when actually there is no motion controllers used at all.
                            CTO | Head of VR Development - Visit us at http://humanxr.com
                            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                            Comment


                              #15
                              Originally posted by vr_marco View Post


                              The FPS template does _not_ use the Motion Controller (right one) unless you edit the FirstPersonCharacter Blueprint and set the UsingMotionControllers? variable to True. If you don't do so, the FPS template simply uses the gun mesh parented to the HMD, which may give the impression the Motion Controller move with the HMD when actually there is no motion controllers used at all.
                              Hey Marco, I have modified the FPS template so that it no longer has a gun, I have attached the oculus hands to the motion controller components that are within the FPS template to begin with? I have also parented the camera and both motion controllers to an Arrow, to reset the height of the VR camera in relation to the ground. I am able to use the HMD and motion controllers perfectly fine, plus I have also tried setting the boolean to true for the motion controllers. (Is that what you mean - image below) However, the problem still persists when rotating the turning your head, the motion controllers follow.

                              Here is the current BP and I have also included a little video test to help explain what I mean with regards to the hands - if you look at 26 seconds, even though im using the right thumbstick to rotate the camera, the same is happening when turning the head....i.e. the hands follow https://www.youtube.com/watch?v=8QEX9skoGm0

                              Comment

                              Working...
                              X