Announcement

Collapse
No announcement yet.

How the heck do you make a door in VR!!

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

    How the heck do you make a door in VR!!

    so I got my VIVE a few weeks back and have been prototyping out some stuff... but one thing that is giving me a real big head ache is creating a door that a player can open with his motion controllers. I feel like im going mad trying to figure this out! lol

    I have trying using physics constraints, attaching the controller to the door knob, etc..

    my door doesn't have to be physics based i just figured that would be easiest but i was wrong. anyone got any ideas on how to open and close doors? any help would be much appreciated
    Last edited by 1HP_And_A_Dream; 09-14-2016, 12:48 PM.

    #2
    Now that I woke up with a different mind set i'm thinking maybe I could do this it using a timeline in the door Blueprint and getting the movement of the motion controller in the relative space of the "motioncontrollerpawn" (the player pawn). get the original location of the motion controller (Hand) when first interacting, then if the movement is positive rotate the door forward and if the location is is going negative pull the door back?

    I'm trying to get something like this but with the motion controllers not a mouse https://www.youtube.com/watch?v=9uaRy0WsoH8

    please any ideas?

    Comment


      #3
      found some good tutorials
      going to try a mix this video and adding a phyics Handle on the motion controller.
      https://www.youtube.com/watch?v=WUprlq8aibc

      will post if works as needed

      Comment


        #4
        If you're trying to do a swinging door, keep in mind that every door is on hinges. This should suggest to you the direction of your solution.

        So, the hinges are a pivot point and you know exactly where they're located, and you also know the size of the door. You also know where the door knob is, and where the players hands are located and whether they are holding down a button or not. This is about all the info you need

        The approach I would take is to consider the pivot points (hinges) to be the center of a circle and what you're going to want to do is sweep the door around on these pivot points. If you look at doors in real life, they only open one direction and have a maximum range between 0->90 degrees. They only open if your hand is on the handle and you push or pull on the door. This should suggest to you the way players should interact with doors: they grab the handle and pull or push the door. So, if a player is holding onto the handle of the door and moving their hand, you would be looking to match the angle of the door to the angle between the players hand and the pivot point. You'd probably want to do an offset to account for the distance between the handle and the door as well, and have threshold values for when the hand is actually holding the handle vs. too far away. Alternatively, the handle could just be used to latch the door in place, and a player could push the door open?

        Anyways, I leave the rest of the math and implementation to you. It should be pretty straight forward from here.

        Comment


          #5
          first off thanks a ton for the reply!!!!!

          what I am gathering from your reply is that maybe I dont need to rely on physics so much, (maybe after it has been open I'll start the simulate physics) but for moving the door around I should use more math? The way you broke it down helped me digest the problem better... sometimes I get micro focused and lose sight of the big picture. I'm about to grab some dinner but I whipped up a simple test blueprint considering what you said and got a box to "look at" the character. i'm guessing that I could do the same with the motion controller and the door? (with the pivot point in the right spot, of course) am I on to the right idea? Here is my simple Blueprint set up that I'm thinking I can use. After I get back from dinner I will test this out and let you guys know the results ... thanks again for reply!!!!

          so ...the steps in my brain go something like this
          -detect hand on knob
          -get input (trigger)
          -use math below to look at hand
          -when let go of trigger stop interaction

          Click image for larger version

Name:	doormaybe.jpg
Views:	1
Size:	142.0 KB
ID:	1115418

          Comment


            #6
            Hi,

            Were you able to get some sort off door working in VR? I am having the same issue and was wondering if anyone has been successful.

            Comment


              #7
              Did you have any luck with this? I am trying to figure out how to create a door that I can open with the vive motion controller. I am new to unreal so kind of at a loss of where to start. You seemed like you had the best luck or at least determination to get it working.

              Comment


                #8
                Why don't you guys try this one. It uses a (free) plugin but for getting your head around it's maybe a good start (also has a door sample in it). I also suggest you take a look at the "Content Examples" & "Blueprints" stuff you find in the Learn tab of the Epic Launcher. Mathew Wadstein also has some great stuff and it's easy to adapt for VR.

                Cheers

                Comment


                  #9
                  There's a door in the VRExpansionPlugin template.
                  Last edited by Zaptruder; 11-21-2016, 10:49 AM.

                  Comment


                    #10
                    I would also add a heavy hitting vibration to the controller when the player is trying to open the door the wrong way or if it's locked. That way they can feel that something is wrong.
                    WIP: Science Project - A collection of middle school through advanced college level science theory and formula-based functions for use in your own projects
                    World Machine to UE4 Export Macro
                    WM Folder Generator - Creates a folder that you name with HeightMap, NormalMap, SplatMap, and Tile sub-folders

                    Comment


                      #11
                      Did you ever figure this out?

                      Comment


                        #12
                        I'd try putting a volume around the door handle. If the controller is inside this volume and grips, save the rotation of the controller. Then, if it rotates around the appropriate axis enough degrees before leaving the volume, the user has turned the door handle. Then I'd be lazy and have a timeline animate the door open :P

                        Comment


                          #13
                          I almost finished the door blueprint for both push and pull interactions in friday. It's not so complicated. To get required Yaw angle just find an arctan of horizontal vector from door axis to controller. It works if your door is vertical.



                          Calculate current speed in every frame (Current Yaw - Previous Yaw) / DeltaTime and compare absolute speed with some min value to decide if you need convroller vibration / sound or not.

                          Pushing is slightly more complicated. At first, after BeginOverlap(...) you need to calculate controller velocity vector [(Current Location - Previous Location) / DeltaTime]. Then you compare initial velocity with current velocity vector. If they're codirectional (dot product > 0) and [current door rotation speed generated by controller] (image above) is greater then [current door rotation speed minus const deceleration], set current door speed to [current door rotation speed generated by controller]. Otherwise, simply apply deceleration to the current door rotation speed. Then apply this speed to door rotation itself. EndOverlap Event is not required here, door stops when current door rotation speed decreases to zero by deceleration.
                          Last edited by YuriNK; 02-19-2017, 02:24 AM.
                          Stand-alone mocap app for Vive Trackers: vrmocapstudio.com
                          Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                          And random stuff at Youtube

                          Comment


                            #14
                            Have you tried using physics constraints component ?
                            VR/AR Development [Portfolio | YouTube | LinkedIn]

                            Comment


                              #15
                              Originally posted by Shin_ji View Post
                              Have you tried using physics constraints component ?
                              Not me. I tried at first, but it didn't work properly.
                              Stand-alone mocap app for Vive Trackers: vrmocapstudio.com
                              Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                              And random stuff at Youtube

                              Comment

                              Working...
                              X