VR Expansion Plugin

Posting excerpts from a conversation I was having in the patreon discord for general public knowledge. Goes over some of the 4.18 secondary grip additions that I added. I will go over things in more detail in a video and patch notes later, but figured since I already wrote , might as well copy and paste it here.

Edit and to be clear, yes the distance based influence is based on the original concept that Node talked about, it is a good idea and was easy enough to support so I added it in.

Dang it, sorry. I failed to enable VR Preview…

Maybe the newest version of the plugin example template doesn’t have it enabled by default? I’m not saying it should, but I’m pretty sure older versions of the template (up to a month ago) had VR Preview set as default, because I’ve never had to enable it.

Thanks for the additional info about VR preview and HMD detection.

I don’t control vr preview either :stuck_out_tongue:

That is an editor feature that is automatically enabled when it detects an HMD, but it normally shows your last used mode, so it likely showed VR preview for you before because that is all you ever launched it with.

Maybe someone has any ideas?

Upd: Ok, I solved the problem. Collision complexity was set to “Use complex as simple” in my mesh. Everything works fine after setting “Project default”. But still it looks like a bug.

its not a “crash” per say, its an assertion thrown by the engine (something was checked to “ensure” it is valid and was found to not be).

In case it is: check(NewMass > 0.f);

The engine tried to calculate a mass for the object and couldn’t get a valid one (not a positive number) and asserted out with a warning.

is very unlikely to be a bug with the plugin and more likely to be a issue with your objects physics setup, negative mass scaling, setting it to 0 mass somehow (boverride clamps it to a min so it shouldn’t happen there).

I’ll still run some checks just in case it is my setup doing it, but its unlikely to be involved.

Edit Yeah its not the plugin, its what can happen when trying to simulate a trimesh collision body


I'm afraid  is a (sensible) limitation of the physics engine. It does not supporting using a triangle mesh as the collision for a dynamic object, it would be very expensive, and is hard to calculate mass properties for etc.

more ▼

answered **Apr 22 '15 at 6:05 AM**

https:\/\/secure.gravatar.com\/avatar\/cb0264335bad95ce50287e10be6b1930?d=identicon

[JamesG](https://answers.unrealengine.com/users/98/jamesg.html)STAFF
1.3k ● 8 ● 5 ● 31


I tried to get an out for it by checking for valid body instance but it still counts as valid with that enabled. I’ll add my own ensure to warn and prevent people from trying to physically pick up a complex as simple body.

Yeah, that’s it. With simple collision works perfectly :slight_smile:

Hi, I got the latest plugin version so I had the netsmoother, it’s working really well on “launch project”, but after packaging I’m getting error on open:

“Missing Dependency, request for NetSmoother but it hasn’t been created yet”

Could you try re-building out of visual studio for the version you are using and then packaging in editor? Feel like its a mismatch between the editor and your package. That normally happens with non default objects but object is entirely default.

I have packaged and ran several times since adding that in with no issues, but I tend to re-build binaries and intermediates very often.

Edit I did have netsmoother below the objects that attach to it in the class structure though, I could conceive of a situation where when serializing it gets to that last so the ones attached to it have issues. I re-ordered it and committed.

Pushed a new commit to the plugin repository today



 Added Epics world locked implementation as an option to the VRStereoWidgets  
 They are still buggy, but should be included anyway  

 Added check to ensure that we don't try to physically pick up an object that is using  
 bUseComplexAsSimple collision.  

  will be more obvious as to why it is crashing out that the default Mass > 0.f  
 warning that is generated normally.  

 Moved netsmoother up higher in serialization.  

 Exposed levers bIsLerping to blueprint so things can use it (see new native lever actor  
 and how it checks it to turn off tick). 

Edit Packaged and pushed live new pre-built binaries

Hi what code would I need to put into my character if I just wanted to be able to work with the VRGrip interface, so if I just wanted to be able to open a drawer of door?

The gripping logic is ran through the GripMotionControllers.

GripObjectByInterface and DropObjectByInterface mostly.

I run a backend in c++, but leave the front end and actual logic of when to grip and drop up to the end user to retain the most flexibility.

Hi ,

Thank you for the quick fix, but we are still getting the error :frowning:

We are running binary engine and a non-c++ project. It runs the game in editor fine, but if we build for windows no editor, launching the game still gives us error :

[2017.10.23-13.25.48:215] 0]LogWindows: Error: Fatal error: [File:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 3004]
[2017.10.23-13.25.48:215] 0]LogWindows: Error: Missing Dependency, request for NetSmoother but it hasn’t been created yet.

Is he not building the netsmoother on package? Any clues on what we should try?

Thank you

We just rebuild everything and it’s now working! I think the issue was that we were doing iterative cooking and he didn’t detect the change in the plugin :-). We did a full build and it’s working now!

Thank you!

Do you mean all logic needs to be copied over to my player because if it does it leaves a load of errors and some BP’s don’t copy over properly.

No, Only if you want the exact same logic as the template has, the template is a very very generic implementation. It is made so that you can do just about everything with it so parts of it are far more complex than most would require (it is also multiplayer enabled which adds significant code base to it).

Simple gripping is literally tracing or overlapping for an object, and then calling GripObjectByInterface from the motion controller with it passed in. You don’t need all of the button mapping or special functions that the template implements unless you really want them.

The basic “grip logic” is below, drawers can use the VRSliderComponent instead though and you wouldn’t even need the “Convert to controller relative transform” node.

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

Nearest Component is just an example, you can pass Actors OR Components in to it, it doesn’t care.

I really need to make a “back to basics” video for how to do the simple things with the plugin, but I have been very low on time recently.

Going over 4.18 changes

Hi,

First, thanks so much for awesome tool!

I have visualization project where I need to dynamically change the camera height, from a child perspective, to adult man, woman etc. Is there a preferred way of doing ? I’m a bit new to Unreal and whenever I think I found a solution the camera resets back to default. I don’t need to change the capsule in anyway, just offset the camera Z (and have it keep that value thru teleportation etc).

Thanks in advance!

​​​​​​​//Adam

Bit of a noobish question…

I’ve got a rift with touch controllers, How would I use the other buttons on my touch controller in the gun example.
So what if I would like to press the B button on my right controller to reload or something.

Thanks a lot!

You don’t really want to change the camera “height”, it would feel like you are standing with your chest at the floor then, what you want to do is change the “WorldScale” and then scale the mesh components as well downwards by the same amount. In 4.16 Epic made multiple changes to the tracked devices so that their tracked positions account for worldscale correctly now, so you should be able to use it without issue.

Now as to how the full blown character performs downscaled? I haven’t tested that in awhile, if you run into issues please let me know as I would like to fully support it.

You’ll have to bind to the button and pass in events to the held object. I support two default interface inputs (OnUse and OnSecondaryUse) but don’t expand further than that (I wanted to make it a generic OnAction passing in a byte code but got resistance to it). If you need more than those two communicative events then its kind of up to you currently to provide them to the object.

I’m trying to reduce plugin bloat so I don’t really want to add yet another interface event in without removing something else.

Edit…actually, I think I might go ahead and add that and mark the other two for eventual depreciation, i’m doing some interface changes in 4.18 anyway, it was long past due.

Hey man, I’d like to thank you again for awesome plugin and your time to help people out. We are currently working on our very first game and your plugin has been a huge help. When we’re ready to announce our game later next month I’ll let you know so you can add it to the list in your OP.