Announcement

Collapse
No announcement yet.

Attach Component to another component

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

    Attach Component to another component

    Hi all,
    this is my first time to use UE4
    and i have problem to attach component to another component
    for the example i have bottle and bottle cap and i want to attach both in vr ( vr template )
    anyone knows how to do it?

    #2
    Look inside BP_PickupCube under Blueprints in the standard VR template. It shows how you attach an actor to the motion controller once you pick it up. The same applies if you want to attach yet another actor to it.

    Mind the fact that if you are holding an actor in one hand and you want to attach the cap with the other hand, you need to detect the overlap of the cap attached to the second hand with the bottle attached to the first hand and then swap the cap by detaching it from the second hand and attaching it to the bottle (and hence to the hierarchy of the first hand).

    If you are new to UE4 this can be tricky at first. Give it a try and report here for more help if needed.
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Hi vr_marco,
      I have tried the blueprint in BP_PickupCube and there are no results

      Originally posted by vr_marco View Post
      Mind the fact that if you are holding an actor in one hand and you want to attach the cap with the other hand, you need to detect the overlap of the cap attached to the second hand with the bottle attached to the first hand and then swap the cap by detaching it from the second hand and attaching it to the bottle (and hence to the hierarchy of the first hand).
      can you teach me how to detect the overlap in this case the bottle and cap ?

      Comment


        #4
        Overlaps between actors are a basic functionality of UE4. If you are not sure about how they work, I would recommend you read first the online documentation or follow some of the many YouTube courses/tutorials.
        In few words, you create overlap detection events (E.g. On Begin Overlap event) for your actors and you react to them by making something "happen". In your case attaching the cap to the bottle for example.
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          Hi vr_marco ,
          thanks for your advice before, now i can attach the cap to the bottle.
          it just add blueprint in the level and overlap the cap attach to socket in the bottle.

          thanks a lot



          now the problem is when the bottle and cap are not too close. the cap is immediately attached to the bottle.
          is there something wrong ?
          Last edited by MasMenOKE; 10-09-2018, 10:18 PM.

          Comment


            #6
            Originally posted by MasMenOKE View Post
            Hi vr_marco ,
            thanks for your advice before, now i can attach the cap to the bottle.
            it just add blueprint in the level and overlap the cap attach to socket in the bottle.

            thanks a lot



            now the problem is when the bottle and cap are not too close. the cap is immediately attached to the bottle.
            is there something wrong ?
            Good! Glad it worked. Check the size of your overlap area. Something is triggering it. You have to cast to the cap blueprint to make sure it is the one causing the overlap, otherwise something else may cause it to trigger and the cap still gets attached.
            CTO | Head of VR Development - Visit us at http://humanxr.com
            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

            Comment


              #7
              Hi vr_marco ,

              I have a problem again, I thought before I managed to attach the two actors but I don't think so. because I tried to take 1 actor and I get close the two controllers together, the two actors were able to atach without getting closer. can u explain something about it ?

              Comment


                #8
                Originally posted by MasMenOKE View Post
                Hi vr_marco ,

                I have a problem again, I thought before I managed to attach the two actors but I don't think so. because I tried to take 1 actor and I get close the two controllers together, the two actors were able to atach without getting closer. can u explain something about it ?
                I don't think it is a collision / overlap issue. There may be something triggering the attach which you have not excluded. That's why I was recommending you to always cast to make sure the overlap is generated by the right actors.
                CTO | Head of VR Development - Visit us at http://humanxr.com
                My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                Comment

                Working...
                X