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

<div class="post-metadata">

**Author:** ![ronaldburns](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ronaldburns/32/956074_2.png) [@ronaldburns](https://forums.unrealengine.com/u/ronaldburns)\
**Post date:** [March 1, 2018, 7:11pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2156 "2018-03-01T19:11:33Z")

</div>

What’s the best way to get the hand and the trigger pull amount while holding a gun?  
Such as…when you pull the trigger on the controller I want to move the trigger on the gun.

---

<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:** [March 1, 2018, 7:19pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2157 "2018-03-01T19:19:22Z")

</div>

> [@Reaver47](#):
>
> Hi all, someone can tell me where download the 4.18 version? i can’t find it on the branches tab ([https://bitbucket.org//vrexpansionplugin/branches/](https://bitbucket.org//vrexpansionplugin/branches/))  
> thank you

Master is the 4.18 version, master will always be the newest current release.

---

<div class="post-metadata">

**Author:** ![chismer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chismer](https://forums.unrealengine.com/u/chismer)\
**Post date:** [March 1, 2018, 8:51pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2158 "2018-03-01T20:51:55Z")

</div>

thank you very much for fantastic plugin! I try to add body tracking following Ghislanzoni’s tutorial  
in [Super-easy VR body with Arm IK and thumbstick locomotion - Unreal Engine 4 Tutorial - YouTube](https://www.youtube.com/watch?v=EKR8ogonD68) I’m finding some problems to put both together. It would be of great help some advice to be able to anchor the camera to the bone of the skeleton as it does in the tutorial.

---

<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:** [March 2, 2018, 3:41am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2159 "2018-03-02T03:41:19Z")

</div>

> [@chismer](#):
>
> thank you very much for fantastic plugin! I try to add body tracking following Ghislanzoni’s tutorial  
> in [https://www.youtube.com/watch?v=EKR8ogonD68](https://www.youtube.com/watch?v=EKR8ogonD68) I’m finding some problems to put both together. It would be of great help some advice to be able to anchor the camera to the bone of the skeleton as it does in the tutorial.

His tutorial is for non roomscale characters, not all of it will apply, attach your mesh to a parent relative component with the bSetToFoot set to true to root it to the camera.

---

<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:** [March 2, 2018, 2:37pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2161 "2018-03-02T14:37:31Z")

</div>

> [@jkopke](#):
>
> Hey, I am struggling with HMD Camera access and render to texture support.
> 
> Is AcquireVRCamera the right way to do it? C  
> CreateCameraTexture2D gives me an empty texture.  
> GetVRCameraFrame fails when I plug an empty var to Target Render Target, and crashes unreal if I plug in an existing texture.
> 
> I’ve made sure my hmd front camera works properly outside of my project.
> 
> Any hints would be appreciated 🙂

CreateCameraTexture2D generates an empty texture of the right format for the camera (size and format). You call that, then pass it in the GetVRCameraFrame.

So:

AquireCamera - Save out the handle  
CreateTexture  
GetFrames  
ReleaseHandle when done

I could have automated all into a component, but wanted to leave it open and just expose OpenVRs functions themselves.

---

<div class="post-metadata">

**Author:** ![FrancescoDeso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrancescoDeso](https://forums.unrealengine.com/u/FrancescoDeso)\
**Post date:** [March 2, 2018, 3:39pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2162 "2018-03-02T15:39:26Z")

</div>

First of all, thanks for awesome plugin! 😃

I’ve got a question though: would it possible for 2 users to grab the same object in multiplayer? I’ve been messing around today a bit, but couldn’t find how to do it. I’ve seen that the default practice is to just “transfer” the object to the other player, when he tries to grab an object already held by someone.

---

<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:** [March 2, 2018, 4:31pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2163 "2018-03-02T16:31:52Z")

</div>

> [@Beriol](#):
>
> First of all, thanks for awesome plugin! 😃
> 
> I’ve got a question though: would it possible for 2 users to grab the same object in multiplayer? I’ve been messing around today a bit, but couldn’t find how to do it. I’ve seen that the default practice is to just “transfer” the object to the other player, when he tries to grab an object already held by someone.

You’d have to change the default BP implementation in the template and then either use the second player as a secondary attachment or run it with physics grips so they both apply forces instead of direct following.

(cut out the Already gripping check and drop logic, late updates would HAVE to be off, likely would want to turn off the defaulted center of mass setting as well)

Anything beyond that is up to you as there is no way of me knowing how you would want that to behave.

I have plans to setup something like anyway eventually using gameplay tags to define an object as multigrippable, but its not a high priority.

There is also a lot of considerations to take into account with multiple players gripping, what behavior exactly are you trying to get?

---

<div class="post-metadata">

**Author:** ![chismer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chismer](https://forums.unrealengine.com/u/chismer)\
**Post date:** [March 2, 2018, 6:19pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2164 "2018-03-02T18:19:05Z")

</div>

> [@](#):
>
> His tutorial is for non roomscale characters, not all of it will apply, attach your mesh to a parent relative component with the bSetToFoot set to true to root it to the camera.

Thanks for your explanation. I solved it in that way (except that I can not find the variable bSetToFoot but it is resolved anyway) and then I followed the tutorial. Thanks again for great plugin and for explanation. Great job

---

<div class="post-metadata">

**Author:** ![Kmack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmack/32/706181_2.png) [@Kmack](https://forums.unrealengine.com/u/Kmack)\
**Post date:** [March 3, 2018, 6:35am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2165 "2018-03-03T06:35:09Z")

</div>

Apologies if has been asked before, but I haven’t spotted a solution if it’s already been addressed: I’ve set up a damage-dealing volume using a conventional trigger-like structure using begin and end overlap, but the issue I’m facing is that the VRCharacter’s Capsule Component is registering overlap events, rather than the VRRootReference. What do I need to change to fix ?

Damage triggers look like the attached example.

The following code allows the VRRootReference to register damage events, but does not keep the capsule component from generating overlap events as well:

```auto

ABFCharacter::ABFCharacter()
    : RightHandGun(nullptr)
    , LeftHandGun(nullptr)
{
     // Set character to call Tick() every frame. You can turn off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;

    GetCapsuleComponent()->SetCollisionResponseToAllChannels(ECR_Ignore);
    GetCapsuleComponent()->bGenerateOverlapEvents = false;
    VRRootReference->bGenerateOverlapEvents = true;
}

```

What did I miss?  
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:** [March 3, 2018, 2:46pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2166 "2018-03-03T14:46:22Z")

</div>

> [@KevODoom](#):
>
> Apologies if has been asked before, but I haven’t spotted a solution if it’s already been addressed: I’ve set up a damage-dealing volume using a conventional trigger-like structure using begin and end overlap, but the issue I’m facing is that the VRCharacter’s Capsule Component is registering overlap events, rather than the VRRootReference. What do I need to change to fix ?
> 
> Damage triggers look like the attached example.
> 
> The following code allows the VRRootReference to register damage events, but does not keep the capsule component from generating overlap events as well:
> 
> ```auto
> 
> ABFCharacter::ABFCharacter()
> : RightHandGun(nullptr)
> , LeftHandGun(nullptr)
> {
> // Set character to call Tick() every frame. You can turn off to improve performance if you don't need it.
> PrimaryActorTick.bCanEverTick = true;
> 
> GetCapsuleComponent()->SetCollisionResponseToAllChannels(ECR_Ignore);
> GetCapsuleComponent()->bGenerateOverlapEvents = false;
> VRRootReference->bGenerateOverlapEvents = true;
> }
> 
> ```
> 
> What did I miss?  
> Thanks!

? What do you mean? The root reference IS the capsule component, I change the base class and provide a pointer to it so that accessing the functions are easier is all.

---

<div class="post-metadata">

**Author:** ![halfsane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@halfsane](https://forums.unrealengine.com/u/halfsane)\
**Post date:** [March 3, 2018, 6:41pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2167 "2018-03-03T18:41:30Z")

</div>

Hi,

I was able to build a new project in 4.18 with the plugin, but I was hoping to use the example to understand how to use some of the features as I am pretty new to .

However, I am not able to build the example project. I tried dropping in the binary plugins as well and switch engine versions from 4.17, 4.18, and 4.19. I can generate VS files, but I can’t build after that. Is there a known issue right now or am I doing it wrong?

---

<div class="post-metadata">

**Author:** ![Kmack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmack/32/706181_2.png) [@Kmack](https://forums.unrealengine.com/u/Kmack)\
**Post date:** [March 3, 2018, 9:07pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2168 "2018-03-03T21:07:39Z")

</div>

> [@](#):
>
> ? What do you mean? The root reference IS the capsule component, I change the base class and provide a pointer to it so that accessing the functions are easier is all.

Hmm. Maybe I have my character set up incorrectly, or I’m interpreting what I’m seeing incorrectly. What I"m observing is that if I draw a capsule at the CapsuleComponentLocation, and another at the VRLocation, the former appears at the center of the tracking volume, while the latter appears at the location of my HMD:

```auto

// draw capsule location & size
    const FVector& CapsuleComponentLocation{ GetCapsuleComponent()->GetComponentLocation() };
    const FRotator& CapsuleComponentRotation{ GetCapsuleComponent()->GetComponentRotation() };
    DrawDebugCapsule(
        GetWorld()
        , CapsuleComponentLocation
        , GetCapsuleComponent()->GetScaledCapsuleHalfHeight()
        , GetCapsuleComponent()->GetScaledCapsuleRadius()
        , CapsuleComponentRotation.Quaternion()
        , FColor::White);

    DrawDebugCapsule(
        GetWorld()
        , GetVRLocation()
        , VRRootReference->GetScaledCapsuleHalfHeight()
        , VRRootReference->GetScaledCapsuleRadius()
        , VRRootReference->GetComponentRotation().Quaternion()
        , FColor::Magenta);

```

So what’s happening is when the CapsuleComponentLocation overlaps a damage trigger, the player takes damage, even though the VRLocation is not overlapping the damage causer. So basically the player takes damage when the center of the tracking volume hits a hazard, rather than when their own perceived location does.

Am I thinking about incorrectly?  
Thanks for looking at with me!

---

<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:** [March 3, 2018, 11:47pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2169 "2018-03-03T23:47:15Z")

</div>

> [@KevODoom](#):
>
> Hmm. Maybe I have my character set up incorrectly, or I’m interpreting what I’m seeing incorrectly. What I"m observing is that if I draw a capsule at the CapsuleComponentLocation, and another at the VRLocation, the former appears at the center of the tracking volume, while the latter appears at the location of my HMD:
> 
> So what’s happening is when the CapsuleComponentLocation overlaps a damage trigger, the player takes damage, even though the VRLocation is not overlapping the damage causer. So basically the player takes damage when the center of the tracking volume hits a hazard, rather than when their own perceived location does.
> 
> Am I thinking about incorrectly?  
> Thanks for looking at with me!

Mmmm, overlaps follow the VRLocation now, I changed how they behave around 4.16 or early 4.17 (sending the correct loc)? I did some testing just to be sure but all trigger volumes are working correctly for me off of the offset location, are you on an older build?

The rootcapsule IS the vrcapsule, I change its physics location and render transform to match the VR offset, the actors root location remains the same though, so things directly reading the root loc would be wrong.

_Edit_ You are dereiving from VRCharacter and not BaseVRCharacter right? Because that would be a different story.

---

<div class="post-metadata">

**Author:** ![FrancescoDeso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrancescoDeso](https://forums.unrealengine.com/u/FrancescoDeso)\
**Post date:** [March 4, 2018, 3:12pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2170 "2018-03-04T15:12:50Z")

</div>

> [@](#):
>
> You’d have to change the default BP implementation in the template and then either use the second player as a secondary attachment or run it with physics grips so they both apply forces instead of direct following.
> 
> (cut out the Already gripping check and drop logic, late updates would HAVE to be off, likely would want to turn off the defaulted center of mass setting as well)
> 
> Anything beyond that is up to you as there is no way of me knowing how you would want that to behave.
> 
> I have plans to setup something like anyway eventually using gameplay tags to define an object as multigrippable, but its not a high priority.
> 
> There is also a lot of considerations to take into account with multiple players gripping, what behavior exactly are you trying to get?

Thanks a lot for the suggestions (and sorry for my later reply)! I’ll try modifying the template project as you said tomorrow.

What I would like to achieve is a “collaborative work” thing, meaning 2 guys moving an object together from one point to another, like a heavy trunk that can’t be lifted by one guy alone. I imagine that there will be lots of problems with , but just to be able to let 2 guys grab the same object would be a good start to work with!

---

<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:** [March 4, 2018, 7:15pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2171 "2018-03-04T19:15:57Z")

</div>

> [@Beriol](#):
>
> Thanks a lot for the suggestions (and sorry for my later reply)! I’ll try modifying the template project as you said tomorrow.
> 
> What I would like to achieve is a “collaborative work” thing, meaning 2 guys moving an object together from one point to another, like a heavy trunk that can’t be lifted by one guy alone. I imagine that there will be lots of problems with , but just to be able to let 2 guys grab the same object would be a good start to work with!

Yeah you either need a custom grip and to define how it interacts like that then, or you need to run with physics grips which can allow for mutliple inputs.

Should be solvable.

---

<div class="post-metadata">

**Author:** ![Kmack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmack/32/706181_2.png) [@Kmack](https://forums.unrealengine.com/u/Kmack)\
**Post date:** [March 4, 2018, 8:40pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2172 "2018-03-04T20:40:52Z")

</div>

> [@](#):
>
> Mmmm, overlaps follow the VRLocation now, I changed how they behave around 4.16 or early 4.17 (sending the correct loc)? I did some testing just to be sure but all trigger volumes are working correctly for me off of the offset location, are you on an older build?
> 
> The rootcapsule IS the vrcapsule, I change its physics location and render transform to match the VR offset, the actors root location remains the same though, so things directly reading the root loc would be wrong.
> 
> _Edit_ You are dereiving from VRCharacter and not BaseVRCharacter right? Because that would be a different story.

Ahhh, I found what was going on. My motion controllers were still generating overlap events, and the usual posture from which I was testing caused the controller positions to coincide with the character origin often enough to produce a result that misled me. Removing collision and overlap generation from the controllers (we’re not grabbing anything in game) seems to have fixed the issue. Thanks so much for looking at it with me!

---

<div class="post-metadata">

**Author:** ![FrancescoDeso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrancescoDeso](https://forums.unrealengine.com/u/FrancescoDeso)\
**Post date:** [March 5, 2018, 10:48am UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2173 "2018-03-05T10:48:35Z")

</div>

> [@](#):
>
> Yeah you either need a custom grip and to define how it interacts like that then, or you need to run with physics grips which can allow for mutliple inputs.
> 
> Should be solvable.

Good to know!

By “physics grips” you mean like the “manipulation grip” type?

---

<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:** [March 5, 2018, 1:02pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2174 "2018-03-05T13:02:27Z")

</div>

> [@Beriol](#):
>
> Good to know!
> 
> By “physics grips” you mean like the “manipulation grip” type?

Manip and interactive with physics, though the latter needs some changes to work really well with it.

---

<div class="post-metadata">

**Author:** ![FrancescoDeso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrancescoDeso](https://forums.unrealengine.com/u/FrancescoDeso)\
**Post date:** [March 5, 2018, 2:03pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2175 "2018-03-05T14:03:41Z")

</div>

> [@](#):
>
> Manip and interactive with physics, though the latter needs some changes to work really well with it.

Alright, I’ll look into it, thanks again!

---

<div class="post-metadata">

**Author:** ![Rogue\_Programmer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rogue_programmer/32/731748_2.png) [@Rogue\_Programmer](https://forums.unrealengine.com/u/Rogue_Programmer)\
**Post date:** [March 5, 2018, 7:32pm UTC](https://forums.unrealengine.com/t/vr-expansion-plugin/68709/2176 "2018-03-05T19:32:06Z")

</div>

Patreon support here and I’ve lost my link to the discord invite. How do I get back into the discord chat channel?

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

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