# 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:** 253

<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:** [January 27, 2024, 4:45pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5163 "2024-01-27T16:45:40Z")

</div>

You can create and load custom Controller Profile’s to offset the controllers to match a stock, or add a relative offset in the grip step to the target grip transform. Both function the same.

---

<div class="post-metadata">

**Author:** ![Mbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbit](https://forums.unrealengine.com/u/Mbit)\
**Post date:** [January 29, 2024, 3:56pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5164 "2024-01-29T15:56:14Z")

</div>

@mordentral  
Found a bug.  
I have downloaded the latest version of the demo project [GitHub - mordentral/VRExpPluginExample: VRE Example Template](https://github.com/mordentral/VRExpPluginExample)

If you set the AttachmentGrip mode for the Gun Base blueprint as in the screenshot, then if you grab the weapon with one hand and hold it down to exit the running VR mode via Esc, you will get an exception as in the screenshot.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/f/48f2c1978c4f2022088868c35bd8c8bedd792a78.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/a/bba07b011df5ab378215c0bfc7a73eb57039d445.png)

---

<div class="post-metadata">

**Author:** ![Mbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbit](https://forums.unrealengine.com/u/Mbit)\
**Post date:** [January 30, 2024, 2:22pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5165 "2024-01-30T14:22:11Z")

</div>

It looks like the problem is in the C++ code of the plugin. Because I tried to directly attach a weapon using the GripObjectByInterface method, bypassing the extra code, as in the screenshot, and ended up with the same error, stack overflow (((  
And this problem is only with the AttachmentGrip mode.

Any ideas, a quick way to fix this? I need the AttachmentGrip mode because… with it, the weapon behaves as it should and does not twitch/catch up with the hands when the character moves from side to side.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/8/b7879d71bc28586b5534713e0b0ed228ccbe887c.jpeg)

---

<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:** [January 31, 2024, 12:43am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5166 "2024-01-31T00:43:34Z")

</div>

Sounds like the engine issue with attachment ensures, not the plugin itself.

You can use physics only or the hybrid with sweep grip modes as well though, they also won’t have latency.

_Edit_ Also what engine version? appears to work correctly in 5.3

---

<div class="post-metadata">

**Author:** ![Mbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbit](https://forums.unrealengine.com/u/Mbit)\
**Post date:** [January 31, 2024, 4:44am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5167 "2024-01-31T04:44:54Z")

</div>

I’m using version 5.3.2 of Epic Launcher.  
It might work on the C++ version of the engine, but I don’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:** [January 31, 2024, 2:31pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5168 "2024-01-31T14:31:48Z")

</div>

Im using the launcher as well, and no such issue. Also your crash is in the scene outliner, not the game logic.

---

<div class="post-metadata">

**Author:** ![Mbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbit](https://forums.unrealengine.com/u/Mbit)\
**Post date:** [January 31, 2024, 2:45pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5169 "2024-01-31T14:45:06Z")

</div>

I’m using oculus quest 2, connecting via air link and then launching VR preview.  
OpenXR plugin included.

It’s very strange that we have different results on the same version of the engine and plugin…

---

<div class="post-metadata">

**Author:** ![Mbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbit](https://forums.unrealengine.com/u/Mbit)\
**Post date:** [February 1, 2024, 1:06pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5170 "2024-02-01T13:06:00Z")

</div>

@mordentral

Question:  
As I understand it, in order for any object to be held with both hands, it must be either a static mesh or a skeletal mesh.  
But what if an object, for example a weapon, consists of several parts. skeletal mesh part with a handle and magazine, there should be a Primary Grip and the second part of static mesh is the barrel, which you need to hold with your other hand.  
What to do in such a situation?  
I tried GrippableActor and added a skeletal mesh and a static mesh to it, but it didn’t work.

UPD:

Is it best practice to use this?:  
Create a GrippableActor and add a collision to it as root.  
Add skeletalMesh and StaticMesh to the collision, arrange them so that the parts become one whole weapon. Align the collision so that the weapon fits completely into it. Add two HandSocketBases to the collision, position the HandSocketBases in the right places on the weapon.

This design seems to work, but I’m not sure if this is the best solution and whether it will work correctly over the network.

---

<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:** [February 5, 2024, 2:23pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5171 "2024-02-05T14:23:53Z")

</div>

If its using physical grips (physics based) you can use multiple full grips across the entire weapon and be fine, and grip sub parts of it as well. If using logical grips that is a different thing all together, which is why secondary attachments exist, to give logical grips something to “rotate towards”.

And no it doesn’t need to be static or skeletal, it just needs to be a primitive period. The plugin can’t infer which sub component you actually want to hold and children can’t move their parents in engine.

If you want modular weapons then sure, what you described would likely be easiest for you to do as it lets any grip method work with it. You would just have to have the baked collision to match the sub parts ready.

---

<div class="post-metadata">

**Author:** ![Bruno.Martelli](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno.martelli/32/594427_2.png) [@Bruno.Martelli](https://forums.unrealengine.com/u/Bruno.Martelli)\
**Post date:** [February 6, 2024, 7:22pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5172 "2024-02-06T19:22:39Z")

</div>

Thanks for this plugin.  
I wondered is there a way to determine what type of HMD is in use in UE 5.3?  
I want to display a different guide image for the controller buttons for VALVE Index, HTC VIVE and Oculus.

_GetHMDType_ returns DT unknown for my VALVE index

Any ideas? it seems that detecting the HMD is the most complex thing ever, even tho’ _XRDeviceVisualization_ can display the correct controller mesh, I can’t figure how to get this info out of 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:** [February 8, 2024, 1:48pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5173 "2024-02-08T13:48:54Z")

</div>

GetHMDType returns which runtime is being ran, if you are on openXR that is a moot point.

You likely want to use GetXRMotionControllerType from the openXR expansion function library.

Also the engines UHeadMountedDisplayFunctionLibrary has a GetHMDData that returns the hmd name.

---

<div class="post-metadata">

**Author:** ![Bruno.Martelli](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno.martelli/32/594427_2.png) [@Bruno.Martelli](https://forums.unrealengine.com/u/Bruno.Martelli)\
**Post date:** [February 8, 2024, 7:49pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5174 "2024-02-08T19:49:26Z")

</div>

Thanks for getting back to me.  
I have tried ‘GetMotionControllerData’ that worked until it decided not to just this afternoon. Get HMDData just says ‘Steam VR/Lighthouse’, not much use. I tried ‘GetXRMotionControllerType’, sadly that fails.  
So my question now is , if it’s working for you, what’s has happened to my VR setup this afternoon, that has changed how it works, when all I did was to calibrate the HTCVive trackpad.

---

<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:** [February 9, 2024, 2:18am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5175 "2024-02-09T02:18:59Z")

</div>

Sounds like you are running steamvr native now instead of openxr?

GetXRMotionControllerType would be failing because you aren’t on openXR now. I have a steamvr expansion plugin that is removed in current versions but had hmd types over steamvr in builds before 5.0.

However you really don’t want to be native steamvr, you really want to be working through openXR.

---

<div class="post-metadata">

**Author:** ![Bruno.Martelli](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno.martelli/32/594427_2.png) [@Bruno.Martelli](https://forums.unrealengine.com/u/Bruno.Martelli)\
**Post date:** [February 9, 2024, 12:08pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5176 "2024-02-09T12:08:31Z")

</div>

> [@mordentral](#):
>
> have a steamvr expansion plugin that is removed in current versions but had hmd types over steamvr in builds before 5.0.
> 
> However you really don’t want to be native steamvr, you really want to be working through openXR.

Thanks for getting back to me, ok so I’m running **SteamVR** , (which incidentally updated yesterday to 2.3.5), I see under _OpenXR_ tab that _Current OpenXR Runtime: SteamVR_

Is this correct?

(Used to be that running an Oculus HMD, I had to swap to Oculus to be the OpenXR runtime in the Oculus App.  
THEN swaping to an HTC VIVE HMD set SteamVR to be Open XR runtime in SteamVR App)

---

<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:** [February 10, 2024, 2:30pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5177 "2024-02-10T14:30:07Z")

</div>

If you have openXR as the default (highest priority) hmd runtime in engine then yes that is fine.

---

<div class="post-metadata">

**Author:** ![Bruno.Martelli](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno.martelli/32/594427_2.png) [@Bruno.Martelli](https://forums.unrealengine.com/u/Bruno.Martelli)\
**Post date:** [February 13, 2024, 2:35pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5178 "2024-02-13T14:35:46Z")

</div>

Thanks! that seems to work!

(i opened _BaseEngine.ini_ from  
C:\Program Files\Epic Games\UE\_5.3\Engine\Config

and set HMD priority like this:

> [HMDPluginPriority]  
> ; Since SteamVR also works with the Oculus Rift, give priority to the native Oculus plugin before trying SteamVR.  
> ; OpenXR is production ready and, if enabled, should be the priority plugin. For 4.27, we still need to prioritize  
> ; the native plugins due to runtime features that are not yet supported in OpenXR.  
> OpenXRHMD=40  
> SteamVR=30  
> OculusHMD=20

---

<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:** [February 13, 2024, 8:46pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5179 "2024-02-13T20:46:10Z")

</div>

Likely final list of changes prior to 5.4 coming out (I assume it will be soon)

[https://vreue4.com/5-3-patch-notes?section=5-3-final](https://vreue4.com/5-3-patch-notes?section=5-3-final)

---

<div class="post-metadata">

**Author:** ![Namekok](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Namekok](https://forums.unrealengine.com/u/Namekok)\
**Post date:** [February 16, 2024, 5:15pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5180 "2024-02-16T17:15:53Z")

</div>

Hello @mordentral

We’re having an issue getting the velocity of the client player.

Our game is multiplayer and LBE, so no movement done with input, only with real physical movement.  
We are trying to get the velocity of that movement to drive the animations on the client.  
Currently, we get the component velocity of the replicated camera of the vr character. This however returns a valid velocity on one frame, but then a zero velocity and the 2 next frames.

Due to that, our animation looks jittery and buggy.  
Is there something we’re missing? Is this a known thing?

Thanks in advance for your time.

---

<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:** [February 20, 2024, 1:45pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5181 "2024-02-20T13:45:15Z")

</div>

You are likely hitting a smoothing stop where its waiting for network updates. I don’t know what smoothing you have set on the camera but if its fast enough that it outpaces the network sends then it won’t have any velocity between updates.

You may want to use a running average on the velocity output.

---

<div class="post-metadata">

**Author:** ![Namekok](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Namekok](https://forums.unrealengine.com/u/Namekok)\
**Post date:** [March 4, 2024, 8:55am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/5182 "2024-03-04T08:55:24Z")

</div>

Thanks! Doing that worked for me 😃

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

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