# VR Expansion Plugin

**URL:** <https://forums.unrealengine.com/t/vr-expansion-plugin/68709>\
**Category:** XR Development\
**Tags:** unreal-engine\
**Created:** [July 11, 2016, 6:16pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709 "2016-07-11T18:16:57Z")\
**Posts on this page:** 20\
**Page:** 157

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 18, 2019, 1:08pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3199 "2019-04-18T13:08:40Z")

</div>

> [@Simply\_Clueless](#):
>
> I just want to thank you so much for giving us amazing public, you have saved me so much time with doing my own research and now I can get straight to work and making my ideas come to life. One of my ideas were to have weighted physics objects that you can grab as seen in games live Blade and Sorcery or the unreleased Boneworks. Is there a way to do that through your implimentation of the grabbing mechanics?

Yes, using the Interactive Collision With Physics grip type is a constraint based grip, you can pass in specific bone names to it and it will grip at that specific bone. Also in the advanced physics options on the grip struct there is the capability to change the grip type from an acceleration based constraint to a force based one, which will give more realistic behavior with that kind of thing.

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

These are the physics settings that you would likely want to use for that kind of thing:

https://i.imgur.com/2bkSX6V.png

You then have to play with the grip stiffness (and/or the custom angular values) until you get a force amount that works well for you.  
It sets the physics grip location to stop setting the center of mass since you want the object to be weighted correctly and turns the constraint type into a force based one. Keep in mind that Angular stiffness and damping will likely have to be a very high values as its units are different than the linear stiffness ones.

You may want to actually turn on setting the COM again if you are gripping something like a sword as it would make the pivot work better.

You can grip the same object multiple times with physics grips since they are force applicators, I actually have it on my TODO list for today to make it easier to manage multiple main grips on a single object, been pushing it off because its going to require people to re-factor a bit.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e604c5d0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e604c5d0](https://forums.unrealengine.com/u/anonymous_user_e604c5d0)\
**Post date:** [April 18, 2019, 2:08pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3200 "2019-04-18T14:08:26Z")

</div>

> [@](#):
>
> Not really, SecondaryGrip is a grip modifier, when you drop the grip itself then the secondary grip modifier is removed. Normally for that tape setup I would have a seperate component on the tape end of the tape measure that the other hand grips, not a secondary grip. That way you can pull out the other end of the tape seperate from the main body.
> 
> Trying to do it with a secondary grip seems like the wrong approach there, two seperate grips (one of the body and one of the tape end as a component) seems more suitable?
> 
> You could also store the secondary hand and not implement a secondary grip at all if you wanted to avoid the extra component, the secondary attachment itself really doesn’t have much use with what you are trying to make there.

I had a suspicion that I was misunderstanding the purpose of the secondary grip, thank you for clearing that up for me!

As a follow-up question, how would I go about differentiating between grips on the separate grippable components? At the moment I have one parent GrippableSphere component with a GrippableBox component where the tape end of the tape measure is. I’ve implemented the VRGrip interface to get access to the On Grip event, but how do I know which component was gripped?

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 18, 2019, 2:53pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3201 "2019-04-18T14:53:26Z")

</div>

> [@Smiddsy](#):
>
> I had a suspicion that I was misunderstanding the purpose of the secondary grip, thank you for clearing that up for me!
> 
> As a follow-up question, how would I go about differentiating between grips on the separate grippable components? At the moment I have one parent GrippableSphere component with a GrippableBox component where the tape end of the tape measure is. I’ve implemented the VRGrip interface to get access to the On Grip event, but how do I know which component was gripped?

Generally the best method is to have your sub component have a method of notifying the parent, like an event that you throw from it OnGrip that the parent binds too. I don’t have default ones because generally sub objects parent containers don’t care if their children are gripped or not.

There is also the OnChildGripped event that is part of the interface as a quick way of doing , but it requires checking against the sub components. It would do if you only have one child that is grippable though as you can just cast to it and use it.

Generally by the way I would have used as grippable static mesh actor for the base, and then the end of the tape could be your grippable box. Also if you are only doing linear measuring you could use a VRSlider component to extend the tape.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e604c5d0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e604c5d0](https://forums.unrealengine.com/u/anonymous_user_e604c5d0)\
**Post date:** [April 18, 2019, 3:15pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3202 "2019-04-18T15:15:33Z")

</div>

> [@](#):
>
> Generally the best method is to have your sub component have a method of notifying the parent, like an event that you throw from it OnGrip that the parent binds too. I don’t have default ones because generally sub objects parent containers don’t care if their children are gripped or not.
> 
> There is also the OnChildGripped event that is part of the interface as a quick way of doing , but it requires checking against the sub components. It would do if you only have one child that is grippable though as you can just cast to it and use it.
> 
> Generally by the way I would have used as grippable static mesh actor for the base, and then the end of the tape could be your grippable box. Also if you are only doing linear measuring you could use a VRSlider component to extend the tape.

Thank you again , that worked perfectly! Your suggestion to change to a static mesh grippable was a great idea, and we now have a working tape measure!

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 18, 2019, 4:58pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3203 "2019-04-18T16:58:09Z")

</div>

Pushed a new update to both Repositories, keep in mind that one will require some actual node changes.  
I usually try and keep that kind of update to between engine versions, but it is early on in 4.22 and I really wanted to work with over the course of engine version.

```auto

Changed the IsHeld Implementation and added AllowsMultiGrip to the VRGripInterface to prepare for some future features.

See Patch Notes:
https://vreue4.com/patch-notes?section=multi-grip-changes-04-18-19

```

---

<div class="post-metadata">

**Author:** ![Kilargo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kilargo](https://forums.unrealengine.com/u/Kilargo)\
**Post date:** [April 19, 2019, 9:03pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3204 "2019-04-19T21:03:48Z")

</div>

> [@](#):
>
> None of the Valve SteamVR plugin is setup for replication currently, in fact the layout of it is somewhat against replication being easily added. I’m waiting for a solid stable version of it (hopefully with some suggested changes) before I decide where to take my module that implements the same thing and how best to merge the two. Currently it doesn’t look very good for me being able to avoid a lot of custom implementation.
> 
> The reason your hand animations are duplicated is because their animation node is directly querying SteamInput for the current hand poses, means it will always take the local players hand poses. I will likely need to create an alternative node that takes an optional transform input to work off of instead of the hard coded query.
> 
> Also though, in most cases you will likely want to replicate and use finger curls / splays for your hand animations, it is more friendly to pose blending and has far less overhead for replication, in that case it would just be replicating the curl values and applying them in the animation graph to blend between a fully closed and fully open hand pose depending on the grip.
> 
> Its really only when nothing is held that you would want to fall back on the full transform list.

Ok so I have an update!

I’ve gotten replication to work except that my client seems to be taking input from the server every other frame resulting in flickering. Not sure what I’m doing wrong, but will keep working at it and post here with the solution for others.

Attaching my code in case anyone can provide an answer.

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 19, 2019, 10:18pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3205 "2019-04-19T22:18:45Z")

</div>

> [@Kilargo](#):
>
> Ok so I have an update!
> 
> I’ve gotten replication to work except that my client seems to be taking input from the server every other frame resulting in flickering. Not sure what I’m doing wrong, but will keep working at it and post here with the solution for others.
> 
> Attaching my code in case anyone can provide an answer.

Ug…those really should be passing / returning an array of values. I wasn’t very happy about them breaking them out per finger like that when an index map would work just as well.

When I eventually make my hard coded replication i’ll be replicating them as a 0-1 scaler since it takes significantly less bandwidth.

As for your “flickering” issue, you need to ignore the “tell client” part on the owning client as its re-setting the client by not ignoring it. Also should all be on a replicated struct or something and not multicast RPCs.

---

<div class="post-metadata">

**Author:** ![Kilargo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kilargo](https://forums.unrealengine.com/u/Kilargo)\
**Post date:** [April 20, 2019, 2:15am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3206 "2019-04-20T02:15:04Z")

</div>

> [@](#):
>
> Ug…those really should be passing / returning an array of values. I wasn’t very happy about them breaking them out per finger like that when an index map would work just as well.
> 
> When I eventually make my hard coded replication i’ll be replicating them as a 0-1 scaler since it takes significantly less bandwidth.
> 
> As for your “flickering” issue, you need to ignore the “tell client” part on the owning client as its re-setting the client by not ignoring it. Also should all be on a replicated struct or something and not multicast RPCs.

Ok. I don’t know how to work with structs yet but I’ll research those when I solve . Thank you for your help.

As for the flickering. I’ll try to figure out how to get the owning client to not fire the “Tell Client” event. I figured I could do something the attached picture, but depending on whether I choose “true” or “false” it either has no effect (keeps flickering between server and client input), or the server takes over input completely and I get full mimic instead of flickering.

Sorry for taking up so much of your time. You’ve been amazingly helpful.

edit: I also tried: get reference to self -\> get controller -\> is Local Controller

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 20, 2019, 3:34pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3207 "2019-04-20T15:34:34Z")

</div>

> [@Kilargo](#):
>
> Ok. I don’t know how to work with structs yet but I’ll research those when I solve . Thank you for your help.
> 
> As for the flickering. I’ll try to figure out how to get the owning client to not fire the “Tell Client” event. I figured I could do something the attached picture, but depending on whether I choose “true” or “false” it either has no effect (keeps flickering between server and client input), or the server takes over input completely and I get full mimic instead of flickering.
> 
> Sorry for taking up so much of your time. You’ve been amazingly helpful.
> 
> edit: I also tried: get reference to self -\> get controller -\> is Local Controller

You want to check IsLocallyControlled on the TellClients multicast (On the received end) and ignore it, not on the actual call server side.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6b7702ea1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6b7702ea1](https://forums.unrealengine.com/u/anonymous_user_6b7702ea1)\
**Post date:** [April 22, 2019, 1:50pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3208 "2019-04-22T13:50:48Z")

</div>

Hey,

I used plugin on my project but my characters head can still go through objects? How do you properly set up the VR Character so that it collides with all objects?

Thanks

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 23, 2019, 3:49am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3209 "2019-04-23T03:49:55Z")

</div>

> [@juggajugs](#):
>
> Hey,
> 
> I used plugin on my project but my characters head can still go through objects? How do you properly set up the VR Character so that it collides with all objects?
> 
> Thanks

It collides with static objects by default, you need to manage other collision channels yourself as to which ones it should collide with and which ones it shouldn’t.

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 23, 2019, 3:51am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3210 "2019-04-23T03:51:26Z")

</div>

Pushed a new patch live to both repo’s that adds a Flight Stick mode to the VRLever, patch notes linked below:

[https://vreue4.com/patch-notes?section=flight-stick-mode-for-vrlever](https://vreue4.com/patch-notes?section=flight-stick-mode-for-vrlever)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_56a5cd65](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_56a5cd65](https://forums.unrealengine.com/u/anonymous_user_56a5cd65)\
**Post date:** [April 23, 2019, 7:11pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3211 "2019-04-23T19:11:20Z")

</div>

I’m trying to play the grab animation even when there is nothing to grab. Sounds pretty straightforward but i’m having a difficult time.

Originally I tried to set the hand state in the pawn, when that had no effect i tried to set the animation like … still no effect, where can I set the grip state? is there an easy way to do ? thanks for the plugin !

update: I found where you can switch animation modes to from blueprints to anim states so that code works now but it doesn’t transition.

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 23, 2019, 9:12pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3212 "2019-04-23T21:12:30Z")

</div>

> [@coteking](#):
>
> I’m trying to play the grab animation even when there is nothing to grab. Sounds pretty straightforward but i’m having a difficult time.
> 
> Originally I tried to set the hand state in the pawn, when that had no effect i tried to set the animation like … still no effect, where can I set the grip state? is there an easy way to do ? thanks for the plugin !

I didn’t have any hand animations or copywrite free hands so I just copied Epics setup over for people that were used to it anyway. The CheckAndHandleGripAnimations functions checks for current overlap state and/or gripping state and assigns an enum value in the AnimBP to control the current hand animation.

---

<div class="post-metadata">

**Author:** ![CokeKuma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CokeKuma](https://forums.unrealengine.com/u/CokeKuma)\
**Post date:** [April 24, 2019, 6:53am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3213 "2019-04-24T06:53:36Z")

</div>

Hi. mordental  
It’s a little far from the question of VR Expansion Plugin, but would you mind if I ask you a question?

I am currently developing a Physics-based VR Melee System.(Currently I am not using the VR Expansion Plugin.)  
Physical handling is performed based on the PhysicshandleComponent, but if you grab and swing a thin collision’s Sword quickly, the Hit does not occur and just passes through.  
VR Expansion Plugin confirmed that problem does not occur. How did you approach it and solve it?

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 24, 2019, 1:23pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3214 "2019-04-24T13:23:40Z")

</div>

> [@WildEric](#):
>
> Hi. mordental  
> It’s a little far from the question of VR Expansion Plugin, but would you mind if I ask you a question?
> 
> I am currently developing a Physics-based VR Melee System.(Currently I am not using the VR Expansion Plugin.)  
> Physical handling is performed based on the PhysicshandleComponent, but if you grab and swing a thin collision’s Sword quickly, the Hit does not occur and just passes through.  
> VR Expansion Plugin confirmed that problem does not occur. How did you approach it and solve it?

I don’t, that is just hull penetration, you would have to adjust your physics settings or manage the collision body better.

---

<div class="post-metadata">

**Author:** ![CokeKuma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CokeKuma](https://forums.unrealengine.com/u/CokeKuma)\
**Post date:** [April 25, 2019, 4:11am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3215 "2019-04-25T04:11:27Z")

</div>

> [@](#):
>
> I don’t, that is just hull penetration, you would have to adjust your physics settings or manage the collision body better.

Thanks for the answer.

How does the VR Expansion Plugin manage Physics Settings?  
If I use a CCD with a large weight of Object Collision and a Mesh Component, I get the result I want, but I feel that the frame is delayed when I use the CCD.  
Do you have something better idea?

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 25, 2019, 12:19pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3216 "2019-04-25T12:19:37Z")

</div>

> [@WildEric](#):
>
> Thanks for the answer.
> 
> How does the VR Expansion Plugin manage Physics Settings?  
> If I use a CCD with a large weight of Object Collision and a Mesh Component, I get the result I want, but I feel that the frame is delayed when I use the CCD.  
> Do you have something better idea?

CCD shouldn’t have any effect on “delay”, its just running collision in substeps. Its more likely that your “weight” being higher is dragging on the constraint. Also I don’t use the physics handle component, I duplicated its setup with several changes and baked it directly into my grip controllers.

---

<div class="post-metadata">

**Author:** ![Simply\_Clueless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Simply\_Clueless](https://forums.unrealengine.com/u/Simply_Clueless)\
**Post date:** [April 26, 2019, 1:06pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3217 "2019-04-26T13:06:13Z")

</div>

I can’t for the life of me figure out how you managed to make the capsule follow the HMD. I researched for ages and they all pointed to yet I don’t see which specific set of functions do that.

---

<div class="post-metadata">

**Author:** ![mordentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mordentral](https://forums.unrealengine.com/u/mordentral)\
**Post date:** [April 26, 2019, 1:15pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/3218 "2019-04-26T13:15:35Z")

</div>

> [@Simply\_Clueless](#):
>
> I can’t for the life of me figure out how you managed to make the capsule follow the HMD. I researched for ages and they all pointed to yet I don’t see which specific set of functions do that.

Its in the VRRootCapsule C++ source, I am overriding the physics thread update and the local rendering to move the capsule. The actual “location” is the same so it took re-writing most of the character class to use the offset location. Its likely not “the” best method, but it was a challenge and I really liked have free reign over where I place the capsule relative to the head without clunky second actors or other methods. It also lets “feet level” be actor zero, which makes a lot of sense when handling things in VR.

Back in earlier engine versions there was an AlternateLocation function on scene components thta would have made it simplistic…sad thats gone now.

[Previous page](https://forums.unrealengine.com/t/vr-expansion-plugin/68709.md?page=156)

[Next page](https://forums.unrealengine.com/t/vr-expansion-plugin/68709.md?page=158)
