Announcement

Collapse
No announcement yet.

Tyre Change in VR with the HTC Vive -ASSEMBLY TRAINING-

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

    #16
    Let's focus on one task at the time. First pick up and drop the wrench.

    When an empty hand overlaps the wrench, you can attached the wrench to that hand. You can use both hands, the overlap event will return the actor of the overlapping hand and you just have to cast it to BP_MotionController. It should be the wrench itself, like a Pickup Cube, that attaches itself to the hand.

    The drop happens when the hand which is holding the wrench overlaps the drop sphere. You can detect that at component level or at actor level. Once it is detected, detach the wrench from the hand like in the Drop of the pickup cubes.

    Once you have obtained a proper pickup/drop of the wrench with both hands, we can move to the next task (the bolts etc.)
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #17
      Hey vr_marco ,

      that's a good idea. Yesterday I could try what I've built. I was in university and tried with the HMD but unfortunately nothing reallly worked
      I had two variants to try.

      First was the selfmade BP for the wrench which includes the socket etc. I could see in the BP Simulation that the Overlap Event worked but there was no attachment to the hand.



      The second one was the PickUp_Cube logic. This one worked but the wrench always snaps to the tip where the pivot of the wrench is.
      I also found a thread in the forum ( https://answers.unrealengine.com/que...ml?sort=oldest ) on which you answered but it didn't work too because of getting an error while compiling.



      Here's where the error appeared:





      Hand always grabs the wrench at this pivot point.



      Because I need the Overlap Event to attach the wrench to the hand, I tried a mixture of both but that didn't work too because I can not connect the 'Other Actor' of the Overlap Event to the 'Parent' of the AttachToComponent.



      Do you have an idea what I'm doing wrong? And why does the wrench snap to the hand at it's own pivot point? I thought it would snap like I said to it in the Mannequin Hand Mesh building the socket. I also tried changing the BP_MotionController like in the thread of Dec '17.



      Another issue was that the VR Hands were very small. Do you know why? Is it because of the World To Meter value?

      I'm despairing a little. Can you please help me?

      Again thank you very much. Without you I would be stranded
      Last edited by Aapeminsch; 02-16-2018, 10:42 AM.

      Comment


        #18
        There are two way to fix your wrench offset problem:

        1) Edit the wrench with a 3D software (Blender, Maya, 3dsmax) and bring the origin to the handle, where the wrench should attach to the hand, then export and reimport into UE4

        2) After you attach the wrench to the hand and it snaps to wherever its origin is (tip), use Add Relative Location to move the wrench into its final desired position. You can also do this "interactively" by assigning some keys to move the relative location and checking how the wrench move in the hand until you find the right offset values.

        I understand that is very difficult for you to develop offline and then go to the Uni to test your progresses. I would recommend that you plan some more time there so you can work directly with the VR system. Or maybe borrow a unit. You can also simulate the movement / rotation of the hands using keyboard + mouse (see a thread I answered few days ago), but it would quite painful to do so.

        We have to go past this hurdle of attaching the wrench to the hand and take it from there.
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #19
          vr_marco

          Ok, thank you. That sounds good and I'll try to bring the origin to the handle with 3DS Max. But I think it's because of merging the different parts of the wrench with the wrench socket/nut.

          But I'm still facing the issue that the BP's I've built doesn't work to attach the wrench to the hand. Do you see what is wrong in my BP's? In the best case it should work with overlapping the wrench with the hand. So I can use the trigger to undo the bolts with the 'snapped/attached' wrench using the simple PickUp_Cube logic.

          Comment


            #20
            Originally posted by Aapeminsch View Post
            vr_marco

            Ok, thank you. That sounds good and I'll try to bring the origin to the handle with 3DS Max. But I think it's because of merging the different parts of the wrench with the wrench socket/nut.

            But I'm still facing the issue that the BP's I've built doesn't work to attach the wrench to the hand. Do you see what is wrong in my BP's? In the best case it should work with overlapping the wrench with the hand. So I can use the trigger to undo the bolts with the 'snapped/attached' wrench using the simple PickUp_Cube logic.
            One thing I noted is that in your overlap event for the wrench you are calling Get Player Character. That doesn't work if your player is a Pawn and it returns null. Use Get Player Pawn, cast it to your MotionControllerPawn and, from it, get the child component for the motion controller to attach the wrench to it.

            https://docs.unrealengine.com/latest...awn/index.html
            CTO | Head of VR Development - Visit us at http://humanxr.com
            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

            Comment


              #21
              Hi Aapeminsch and Marco, I am also trying to achieve the same thing, that is grabbing and snapping objects with another objects. But in my case I am trying it on Car Engine.
              I just started working on it, I am far behind compared to you people. Hope I will get knowledge from your discussions. Just wanted to know if you were able achieve snapping to right position? If yes please help me with snapping.

              Comment


                #22
                Originally posted by Anand Kumar 9 View Post
                Hi Aapeminsch and Marco, I am also trying to achieve the same thing, that is grabbing and snapping objects with another objects. But in my case I am trying it on Car Engine.
                I just started working on it, I am far behind compared to you people. Hope I will get knowledge from your discussions. Just wanted to know if you were able achieve snapping to right position? If yes please help me with snapping.
                Yes, Aapeminsch has progressed quite a lot on that. He has a great experience set up by now. I am sure he can give you some tips about what has worked and what hasn't for him.
                CTO | Head of VR Development - Visit us at http://humanxr.com
                My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                Comment


                  #23
                  Hi Anand Kumar 9,

                  like vr_marco said I've progressed a very good experience with his help. If you could explain a bit more what you're trying to achieve I can certainly help you.

                  You may have already read our previous discussion. So the first thing you have to know is how sockets work. Very important on using sockets in VR is that you have to add the socket to the hand, not to any of the fingers because the mesh will move with the fingers animation. Moreover you have to set the origin of the mesh you're trying to snap to the hand in a 3D Software like 3DS Max, Blender etc. to a useful point like handle of the tool or something.

                  The thing that worked very good for me was picking up the tool by hovering over it (OnComponentBeginOverlap) and preventing it from responding to the trigger button of the Motion Controller by deleting the PickUp and Drop Events. So you still have the possibility to use the trigger button for picking up other objects with the snapped tool in your hand. To drop the tool you have to add something like a Drop Sphere where the tool gets detached from the hand by overlapping this sphere.

                  To pick up things like bolts etc. you have to add another socket to the hand and set the mesh in your required position to the tool. Then for this object use the simple PickUp Cube logic from the VR Template and set the socket in the AttachToComponent node (don't forget to set Location/Rotation rule to 'Snap to target').

                  If you have any more questions let me know.

                  Comment


                    #24
                    Hi Aapeminsch and Marco
                    Thanks for your replies, we were actually working on Archviz from two years, we did some projects for architecture. I used Bluelprints for simple Archviz functions like door opening, grabbing objects with HTC Vive, lights on off and so on, but now this one is bit tough and more detailed one.

                    As now we want to try new things, like assembling and disassembling the car engine. As this is new to us, we are really struggling a lot.
                    We are right now following Wrench VR Game https://forums.unrealengine.com/comm...ut-fixing-cars.

                    I just started with a cylinder, tube and a sphere just to see if I can get the snapping work with it. But till now I am not able to do that. I think I am missing something.
                    I will update my work in progress may be tomorrow with screenshots and details so that you people can review it.

                    May be I should switch to your method, I mean make use of your ideas or blue prints that you shared.

                    Comment


                      #25
                      Hi Anand Kumar 9 ,

                      the Wrench VR Game is just amazing. I've seen this before and the level of detail is incredible good.

                      Please post some screenshots of your progress and I'm sure we can fix your problems together. Do I understand right that you're trying to snap a tool to the Hand to release for example bolts from the cylinder cover etc.?

                      At first forget about the BP's in the discussion. They are at an old status and won't work like expected.
                      Last edited by Aapeminsch; 03-14-2018, 10:26 AM.

                      Comment


                        #26
                        Hi Ralf,

                        I am attaching my screenshots, we tried 2 methods, one is Wrench and another one is UVRFPlayground method. We are still trying UVRFPlayground method using its Gun and Magazine BP's.
                        No much progress. Like you said we are not trying to snap the tool to Hand. Instead we are trying to snap the object which is currently in hand, to other object in the scene.
                        And thanks for your support, that you want to help us in solving this. I am feeling we really dont know the basics of how this actually works. We wasted time in ArchViz.
                        Attached Files

                        Comment


                          #27
                          Anand Kumar 9 There are few basic things you need to understand first. They are related to how pickup/drop is implemented in the standard VR template (which I understand is what you are building onto). Here is how it should work:

                          1. When you pickup something (your sphere), that corresponding actor is attached to the Motion Controller component, part of BP_MotionController. As a matter of fact, it is added at runtime to the hierarchy of BP_MotionController as a child actor of the Motion Controller component. From that moment on, until you detach it, it behaves like a component of BP_MotionController. If you look at the Event Graph of BP_PickupCube you will see the AttachToComponent and DetachFromActor taking place on the Pickup and Drop events.

                          2. If you want the sphere, which is now attached to your hand, to snap to another actor (your cylinder) when you get close enough to it, you need 1) to detect the overlap between the cylinder actor and the sphere component of the BP_MotionController, then 2) detach the sphere from the BP_MotionController and finally 3) attach the sphere to the cylinder actor in a specific snap position. The last step can also be accomplished by not attaching the sphere to the cylinder, but just blocking it into a specific position. It depends what you want to do afterwards with it.

                          3. To attach an actor to a skeletal mesh actor in a specific position, the best option is to define and use a socket. Sockets can be defined inside Persona (the skeletal mesh editor) and are attached to a parent bone. They get a name used to reference them. When using AttachToComponent, you can then use the name of the socket you want to attach the actor to and use the Snap to Target options so the actor gets the orientation of the socket. It doesn' t matter for a sphere, but if you are attaching a weapon to an hand, it matters how the weapon is oriented respect to the hand.

                          I let Ralf (@Aapeminsch) add to this out of his experience.
                          CTO | Head of VR Development - Visit us at http://humanxr.com
                          My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                          Comment


                            #28
                            Hi Marco,

                            Thanks for your reply.
                            We made some progress today after scratching our head for sometime, we started with new project, we followed Wrench method. We used 3rd Method, like you said above.
                            I have attached screenshots game play. What we did is, used one simple skinned triangle, skeletal mesh added collision, socket. Created Sphere Parent Class according to Wrench. Now we are able to snap the sphere to the triangle (changed from cylinder)
                            Thank you both of you for your help and support.
                            Attached Files

                            Comment


                              #29
                              Hi Anand Kumar 9 ,

                              sorry for not responding so long but I had some work with my project writing a report etc.

                              As I can see you made some good progress. Is your main question solved with that or do you need some further help? Please let me know if you have other questions.

                              Comment


                                #30
                                Hi Ralf,

                                Sorry for late reply. And yes we made some progress with respect to snapping. We even tested with Engine Parts and its working as first basic step, with multiple objects.
                                But now we want to go to next step, that is with assembling and disassembling with multiple objects assembly.
                                Our first question is answered and thanks for you both people support. We will keep you posted about our progress and if we get into any trouble I will surely come back to you people for help

                                Comment

                                Working...
                                X