VR Expansion Plugin

Hi all,

I am working away on my project, its coming on nicely.

I’m hoping to find some ‘newby talk’ help.

It might seem really simple (hopefully it is. But I’m having a nightmare changing key bindings.

when i pick my pistol up, it shoots on pickup. I would like to grip and drop using the grip button on vive.

When i change it in settings, the whole grip fails.

Please can someone give me a self palm to forehead moment.

Also, weapon sounds don’t play in vr standalone testing. Not gug into one yet.

Thanks all.

Wrote an article on some VR development quality of life stuff. Let me know if anyone wants anything else documented. It’s nice to have on hand. UE4 VR Development Tips pt.1 – Life Art Studios

When gripped the grip functions purpose is to maintain the given grip transform on tick, you have several options for custom rotations.

#1. Set the AdditionTransform rotation to add rotation to the grip
#2. Set the GripRelativeTransform to the rotation that you want directly relative to the hand
#3. Use grip mode “Custom” and run the positioning logic yourself

#4 (best overall). Create a custom grip script where you override the GetWorldTransform function and modify the rotation to whatever you want, is the point of the grip scripts, to allow you to inject whatever custom logic you want in between the actual grip logic.

(bit dated but still valid GS tutorial): https://www.youtube.com/watch?v=Mj93T1Zwo5M

I’ll note however that just handling with the secondary attachment system should “just work” and is typically how people do bows with the plugin, using the back hand as the secondary attachment for the front hand.

Change the BP logic to precheck and either branch to OnUse or Check for a grip depending on your modifier button, all of that logic is there in the template for you.

The template has gameplay tags setup for testing input schemes, people have been using them in their final projects (though there are other ways of going about it).
If you notice the template gun has the grip button set to trigger, but the drop button set to side grip, then use is set to trigger, so you can use it while holding it but drop with the alternate grip button.

In 4.26 i’m overhauling the gameplay tag names to match the new input event names of PrimaryGrip, SecondaryGrip and Use though. Since the engines input system changed so much.

https://i.imgur.com/yWKTJ7M.png

Thanks for the explanation on that.

Running into a an issue though, whenever a melee weapon is let go of with both hands, tick turns off… I deleted all the set ticks on the melee base actor, yet tick always turns off, and turning it on afterwards does nothing…

Is there something in the grip script causing ? or is something strange on my end?

Thanks again

Thanks for your reply. Maybe add a bow to the template? Maybe I am overthinking .

Thanks for the reply.

You are a STAR!

No there is nothing in the grip script itself that changes its parents ticking. All of the tick settings are in the melee base on penetration or grip adjustment.

Hmmm… .must have been a corruption then…

Printing the tick works until the object is let go of, then the print stops… and i had removed all set ticks from the class…

I’ll revert the file to and older and see what happens…

Really strange bug to me

I wanted to make a note in here, as of the end of the current patreon billing cycle I am taking the rewards off of it and putting the private support discord public.
Feel like its time, now that the core users in there are competent and the plugin is more stable than before, the discord reward was a gate on my time so that I could still have spare time to work on things, however the community in there has been helping each other for awhile now so I think that opening it up more will let people work together better.

Should also take some of the micro management away from me checking 7 different messaging systems so I can get more done on the programming side.

Hey I just started testing out the plugin, awesome work! Thank you so much for great starting point. Wanted to report a bug tho, the first thing I tried in the example level was to grab the gun in one hand and use the other hand to move in Navigate mode while shooting. Currently it freaks out and starts zig-zagging, any idea why?

The bullets are set to still collide with the gun, if you turn that off it won’t care. I keep them colliding as it helps to stress test some things from time to time. You wouldn’t really use large spherical projectiles anyway on a game gun usually.

So far plugin looks so powerful. I’ve yet to dive into it deep yet but I do have a quick question. Should the hand animations work out of the box with the example level? When I open up that project and mess around in the level everything works perfectly except I get no hand animations. I’m on the Rift and running UE4 4.25

Sorry if is a dumb question. I read through most of the documentation and didn’t notice an obvious answer so I came here. Thanks for all the hard work that’s gone into !

No, I don’t use any of oculus’s specific stuff, you can port it in at will. Since oculus did a good job of handling an interface for it themselves there was no need for me to re-do the effort.

Going into OpenXR when it is stable I will be supporting hand tracking through the OpenXR interface though so that it is cross platform and doesn’t require extra effort. My open input module for the steamvr hand tracking will be deprecated and everything will be unified in the main plugin itself under openXR.

What exactly is it that I need to port in? Is it just the animations that don’t work with the Oculus or would you recommend not learning from the example level if I’m developing for Oculus?

I’m not entirely sure what animations you are talking about, I thought you were talking about the hand on controller animations or hand tracking streaming?

If its the hand streaming that isn’t a part of the core engine until 4.26 and is on a seperate oculus branch.

Hi,
i have a question regarding replicated movement of an object with a custom grip script on it.

So i created a gun-slide (ParentClass: GrippableStaticMeshComponent) using the VRGrip interface with GripType set to CustomGrip. For that custom grip i implemented movement constraints and some other stuff. The slide itself is being added to the parent weapon as a child component.

For the slide movement there are two options:

  1. The slide is manipulated manually by gripping it. works as expected and slide movement is also being replicated to other clients.

  2. The slide is moved through gun logic, namely shooting the gun. For i am using SetRelativeLocation on the slide component. Now when in single player, SetRelativeLocation works without problems. The slide moves forwards and backwards as my logic dictates it to do. However when trying to replicate that movement the SetRelativeLocation does not move the slide component at all.

My current approach to replicate the slide movement mimics what the template’s GunBase-BP is doing in FireGun -> FireGunServer -> FireGunLocal. So i’m having a call to the server who then again does a Multicast to all other clients which again fires a function “MoveSlideLocal”. (Like stated already the code inside MoveSlideLocal works fine in singleplayer) I can tell that the RPC arrives at the clients, because if i add some other stuff to the “MoveSlideLocal” code - e.g. a particle spawn - then i see that happen on all clients. However the SetRelativeLocation node has no effect at all.

So my question is, whether there is something in the GrippableStaticMeshComponent / VRGrip that i need to take into consideration when trying to replicate non-gripped movements. I also found some other general threads from users having problems using replication with regard to SetRelativeLocation, however those were old and i wasn’t able to draw any conclusions from those.

Cheers for any help on !

Physics Grasping hands left hand seems to grab things with an incorrect offset compared to the right hands grasp… Is normal? It seemed to happen in the default template too.

Also having an issue where if letting go and grabbing an object in the same frame with the left hand will rotate and scale it down to it’s default transforms I believe it’s using the controllers transforms., but the right hand keeps the item held in position fine.

What would be the right way to drop only 1 item from multiple items being held in the hand? If I have just one item drop, the grasping hand acts as though it let go of the original held item. What would be the best way to set up, to let a single item drop from the phys grasping hand, while not breaking the originally held items grasp?

As always, any help is appreciated…

  1. I don’t remember any left hand offset no, but it is a separate skeleton entirely (since inversed physics are broken), the ideal left hand would be a mirrored and flipped version of the right but I don’t have one of those to work with. You may need to adjust the palm sphere a bit, also the gripping animation has some offset to it that is manually removed that the right hand doesn’t have. The non physics version should obviously be without the issue, I can’t take a hard look at it at the moment without recompiling shaders in 4.25.

  2. Dropping and gripping before the lerp back to the hand finishes could be a bad edge case yeah, you may want to delay until the hand has returned to resting before allowing another grip, or not return back for a frame or so. Its not physically possible to drop and grip in the same frame physically so I assume you are manually doing it.

  3. Only change animation state when the hand has zero held objects or not the one it curled around, its obviously going to be based on some game logic though depending on which one you actually curled around, you’ll need to put in your own logic to handle that, the grasping hands are an example, not a full fledged system, they are intended to be expanded on and be a baseline.

Hi there,

Do you have any examples of how to utilise the drop and socket system.

Thank you

They don’t just start further away, but one of the hands can get stuck in the floor as well upon start of game, until I start using the controller input, and then the hand seems to fly back towards me. is using Grasping Hands, btw, so not sure if there is something to be tweaked when using that mode.

Sorry, not sure what you mean by re-zero’d base with 4.25. I am using 4.25 with SteamVR, of course, though.