Announcement

Collapse
No announcement yet.

VR Expansion Plugin

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

    Okay, I'm having trouble with creating a holster or slotting system. It's gripping but not by motion controller(s). Most common is pickup a sword and holster it to your hip. If I AttachComponent then gripping no longer works to unholster the sword. I was hopping to find a example of where any actor can perform a grip action not just the grip motion controller component. To me it the same issue if you build a gun with parts you can attach (different sights - upgrade gun by attaching components). The parts would be grip but then need ability to attach/unattach/swap. Any idea how one accomplish this?

    Comment


      Originally posted by Sooth View Post
      Okay, I'm having trouble with creating a holster or slotting system. It's gripping but not by motion controller(s). Most common is pickup a sword and holster it to your hip. If I AttachComponent then gripping no longer works to unholster the sword. I was hopping to find a example of where any actor can perform a grip action not just the grip motion controller component. To me it the same issue if you build a gun with parts you can attach (different sights - upgrade gun by attaching components). The parts would be grip but then need ability to attach/unattach/swap. Any idea how one accomplish this?
      Gripping works fine on attached things.....if it is not an attachment grip or a physics grip (both of those automatically remove attachment by their very nature) then it will need to be detached OnGrip though, I do not automatically call Detach as in some cases you will want it to remain attached and I do not assume.

      As for holstering FROM a grip, calling DropAndSocket is generally the best way as it is an all in one node for that, but dropping and then attaching is also fine.


      In a general contextual sense Attachment is exactly what you are looking for regarding scopes / additions....there is no general "grip" system and one would be a far worse use for that case than just attaching. I think you may be a bit confused about how the engine works in general, every scene component or actor that is a "Child" of another one is "attached" to it.

      You can look at the Potion and the Gun in the template for how they current dictate attaching to the waist on drop as well.


      Consider supporting me on patreon

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

      Comment


        Okay, I missed the call to 'Set Simulate Physics' off on the static mesh component. I did not realize you could holster the gun or potion to your body anywhere. In the Gun case I see you implemented RequestsSocketing override. I just totally missed this when going through the tutorial room stuff. Okay, so I get how to do this properly with the plug-in.

        I also looking to do some really advanced dynamic socketing. In my current implementation which I'm trying to convert to your plugin, I define a spline along the handle(s) of the weapons where a gripping is allowed. A marker is displayed where the final grip will occur along the spline based on where the hand is located. Like your VRSlider but the cube moves to be near the hand along the spline and OnGrip the cube marks the grip location. So to do this i have to highlight the item (weapon) based on hand proximity or hand jedi pointing at a weapon. Best to use RequestSocketing and your VRSlider to implement this style of gripping?

        Comment


          Originally posted by Sooth View Post
          Okay, I missed the call to 'Set Simulate Physics' off on the static mesh component. I did not realize you could holster the gun or potion to your body anywhere. In the Gun case I see you implemented RequestsSocketing override. I just totally missed this when going through the tutorial room stuff. Okay, so I get how to do this properly with the plug-in.

          I also looking to do some really advanced dynamic socketing. In my current implementation which I'm trying to convert to your plugin, I define a spline along the handle(s) of the weapons where a gripping is allowed. A marker is displayed where the final grip will occur along the spline based on where the hand is located. Like your VRSlider but the cube moves to be near the hand along the spline and OnGrip the cube marks the grip location. So to do this i have to highlight the item (weapon) based on hand proximity or hand jedi pointing at a weapon. Best to use RequestSocketing and your VRSlider to implement this style of gripping?
          You can switch a held objects grip type to custom when it overlaps your area and manually handle tracking it to the spline it you want, the grip types are able to be set live.

          It would be a good use case for a grip script though, you can either have one already on the item or add one live when its within the area that takes a spline and forces the held object to follow it.


          Consider supporting me on patreon

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

          Comment


            Okay, I missed the call to 'Set Simulate Physics' off on the static mesh component. I did not realize you could holster the gun or potion to your body anywhere. In the Gun case I see you implemented RequestsSocketing override. I just totally missed this when going through the tutorial room stuff. Okay, so I get how to do this properly with the plug-in.

            I also looking to do some really advanced dynamic socketing. In my current implementation which I'm trying to convert to your plugin, I define a spline along the handle(s) of the weapons where a gripping is allowed. A marker is displayed where the final grip will occur along the spline based on where the hand is located. Like your VRSlider but the cube moves to be near the hand along the spline and OnGrip the cube marks the grip location. So to do this i have to highlight the item (weapon) based on hand proximity or hand jedi pointing at a weapon. Best to use RequestSocketing and your VRSlider to implement this style of gripping?

            Comment


              ? You just repeated your prior post


              Consider supporting me on patreon

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

              Comment


                I had an issue with skeletal meshes where the root bone is not the base where physics body root is causing were grip rotations. I added logic to correctly find the root physics in the skeletal mesh and this resolves this issue. Don't know if any other user has hit this issue but I did.

                // I actually don't need any of this code anymore or the HandleInfo->RootBoneRotation
                // However I would have to expect people to pass in the bone transform without it.
                // For now I am keeping it to keep it backwards compatible as it will adjust for root bone rotation automatically then
                USkeletalMeshComponent * skele = Cast<USkeletalMeshComponent>(root);
                if (skele && skele->GetNumBones() > 0)
                {
                // RJM - Was RootBoneRotation = FTransform(skele->GetBoneTransform(0, FTransform::Identity));

                // RJM - Not all skeletal meshes have root bone as 0 for physics
                // need to know which one it is.
                int rootBone = 0;
                FBodyInstance* rBoneInstance = nullptr;
                for (int bone = 0; bone < skele->GetNumBones(); bone++) {
                rBoneInstance = skele->GetBodyInstance(skele->GetBoneName(bone));
                if (rBoneInstance != nullptr && rBoneInstance->IsValidBodyInstance()) {
                rootBone = bone;
                break;
                }
                }

                RootBoneRotation = FTransform(skele->GetBoneTransform(rootBone, FTransform::Identity));

                HandleInfo->RootBoneRotation = RootBoneRotation;
                }

                Comment


                  Thanks for your thoughts on the spline grip case. I have to experiment with what will work best.

                  Comment


                    Originally posted by Sooth View Post
                    I had an issue with skeletal meshes where the root bone is not the base where physics body root is causing were grip rotations. I added logic to correctly find the root physics in the skeletal mesh and this resolves this issue. Don't know if any other user has hit this issue but I did.

                    // I actually don't need any of this code anymore or the HandleInfo->RootBoneRotation
                    // However I would have to expect people to pass in the bone transform without it.
                    // For now I am keeping it to keep it backwards compatible as it will adjust for root bone rotation automatically then
                    USkeletalMeshComponent * skele = Cast<USkeletalMeshComponent>(root);
                    if (skele && skele->GetNumBones() > 0)
                    {
                    // RJM - Was RootBoneRotation = FTransform(skele->GetBoneTransform(0, FTransform::Identity));

                    // RJM - Not all skeletal meshes have root bone as 0 for physics
                    // need to know which one it is.
                    int rootBone = 0;
                    FBodyInstance* rBoneInstance = nullptr;
                    for (int bone = 0; bone < skele->GetNumBones(); bone++) {
                    rBoneInstance = skele->GetBodyInstance(skele->GetBoneName(bone));
                    if (rBoneInstance != nullptr && rBoneInstance->IsValidBodyInstance()) {
                    rootBone = bone;
                    break;
                    }
                    }

                    RootBoneRotation = FTransform(skele->GetBoneTransform(rootBone, FTransform::Identity));

                    HandleInfo->RootBoneRotation = RootBoneRotation;
                    }
                    Mmm, that is a valid point, though I am unsure as to why you would be using a non 0 root for a physics simulating body.

                    I added something like your logic to it, i'll port it back to 4.20 / 21 as well.
                    Last edited by mordentral; 02-23-2019, 08:42 PM.


                    Consider supporting me on patreon

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

                    Comment


                      It's caused by exporting meshes from UE4 to Maya and then reimporting. UE4 adds a new root bone which the artist did not realize was happening. Now it's to late to fix this by redoing the assets over again.

                      Comment


                        Originally posted by Sooth View Post
                        It's caused by exporting meshes from UE4 to Maya and then reimporting. UE4 adds a new root bone which the artist did not realize was happening. Now it's to late to fix this by redoing the assets over again.
                        Well I implemented revised logic to get the first body (much like yours), I believe that one or two people reported something similar in the past but were never able to give me a good reproduction.

                        So thanks for the contribution.

                        Its ported from 4.22 back to 4.21 currently.


                        Consider supporting me on patreon

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

                        Comment


                          Question,

                          I've been trying to add a system that allows the user to either pull or push gripped objects closer or further away from themselves. However, I've been unable to figure out where I am able to set the world offset setting that gets set when "Grip Component" gets called. Using add relative transform or update relative transform causes the object to fly away, and setting the gripped object's world location doesn't update the grip's world offset, causing objects to ping back to their initial grip position. Are there any examples of this functionality? Best example of what I mean is similar to the grabbing system in "I expect you to die" where you can slide objects along a tether so to speak.

                          Thanks
                          Portfolio

                          Default Interactive

                          A Skip And A Hop Too Far Into Light Speed

                          Comment


                            Originally posted by Defaultsound View Post
                            Question,

                            I've been trying to add a system that allows the user to either pull or push gripped objects closer or further away from themselves. However, I've been unable to figure out where I am able to set the world offset setting that gets set when "Grip Component" gets called. Using add relative transform or update relative transform causes the object to fly away, and setting the gripped object's world location doesn't update the grip's world offset, causing objects to ping back to their initial grip position. Are there any examples of this functionality? Best example of what I mean is similar to the grabbing system in "I expect you to die" where you can slide objects along a tether so to speak.

                            Thanks
                            Unsure what that is like as I have not tried that game but setting addition transform will work. You'll want to rotate the vector of movement by the controllers orientation relative to the object. You can get the current relative transform by breaking the Grip structure and even directly set that yourself.

                            Add relative transform won't work unless you are doing an attachment grip as relative transform is in world space in all other grips. Also setting its world location also wouldn't work as you found out because the grip logic keeps moving the object to the correct location.

                            I would take a look at the gun in the example template, how it handles recoil is using the addition transform and you can abuse the same kind of logic to move your held object.

                            If you find the addition logic too complicated you can also use CustomGrip type and manually move the object as you wish, or switch over to it from another grip type live.



                            *Edit* Alternatively in newer versions of the plugin there is the CustomPivotOverride that you can set, it lets you assign another scene component (not the controller) as the base point for grips, this makes things like this significantly easier as well as you can just move that base component around to adjust the final location.

                            As seen in this video:



                            You use it by setting like below (preferably BEFORE gripping something, like in begin play).




                            Consider supporting me on patreon

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

                            Comment


                              Here is a video going over something I am playing around with in 4.22 beta.



                              Consider supporting me on patreon

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

                              Comment


                                Ah those laser pointers are basically what am after! Only difference is that they can be adjusted in length so to speak. I'll have to look into using that custom pivot, sounds like what I am after.

                                Also minor thing, Unforgiven was renamed to "Virtual Escape: The Play Room" on your list of games that use the plugin. Also, the game is undergoing updates that will bring it to use the latest version.

                                Thanks again for this plugin, amazed at the amount of time you put into it after all this time!

                                EDIT:

                                Custom pivot was exactly what I wanted, works perfectly!


                                Cheers
                                Last edited by Defaultsound; 02-26-2019, 05:11 PM.
                                Portfolio

                                Default Interactive

                                A Skip And A Hop Too Far Into Light Speed

                                Comment

                                Working...
                                X