Unreal + VRExpansion — A deep dive on getting your VR game’s physics “just right”

Viral Tagdiwala
2 min readMay 30, 2021

--

In Early May 2021, our team started working on a concept game that blends RPG in a Japanese setting.

There are two major parts which from the get-go, we knew we’d have to nail (over and above actual gameplay) to stand a chance to have some market share in the up and coming VR games segment and that were

  1. Getting the game well optimized to run on stand-alone devices like the Oculus Quest 2 (i.e. hit a minimum frame rate of at least 90fps)
  2. Having the physics of the interactions feel realistic in VR

The former is a beast which I personally, haven’t tried to fight (yet) but the latter was something I got my hands dirty with!

VRExpansion is one of the best out there! Albeit, the documentation could be better, but the example app provides pretty much everything you’d want!

Installation is pretty straightforward!

  1. Download the plugin from here https://github.com/mordentral/VRExpansionPlugin
  2. Place it under /Plugins in your app
  3. Re-open the project -> Plugins and you should be able to see VR Expansion!

Here’s a quick video of how you can go about it!

Once it’s installed, you can choose to use their methods and try to “Gel things in” your own project, or, if you are starting a fresh project, then it’d be better to port over the functionality you need via their example app.

This, however, can be a bit tricky!

  1. We start off by downloading their example app https://github.com/mordentral/VRExpPluginExample
  2. Once it’s open, follow this video

3. Now, comes the tricky bit. If your project is complicated you’d have to copy the following snippet inside your defaultengine.ini

[/Script/Engine.CollisionProfile]

+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,Name="VRTraceChannel",DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False)
+EditProfiles=(Name="PhysicsActor",CustomResponses=((Channel="VRTraceChannel")))
+EditProfiles=(Name="BlockAllDynamic",CustomResponses=((Channel="VRTraceChannel")))

An easier alternative would be to simply transfer the files residing inside Config of the example app inside yours, however this may not be possible if you decide to have the plugin integrated at a late point in your project development.

4. Next simply migrate contents you need like so -

As I show towards the end of the last video, the expansion pack does make physics w.r.t grabbing objects, climbing swimming driving all a breeze!

--

--

Viral Tagdiwala
Viral Tagdiwala

No responses yet