Interactions And Collision Presets

Last Updated 29/11/22

How to set up and install the GDXR VR Template Plugin.

Interactions


The GDXR VR Template contains a variety of interactable actors. This page is going to go over the use of setting them up and why we changed it.

So the GDXR VR Template makes use of a actor class of character type, this is used to create the GDXR_VRCharacter blueprint which contains all our inputs, controllers, camera and much more.
We do this as it allows use to take advantage of a capsule component and Unreals built in character Movement component.

In return it allows our player to have gravity, collisions with environment meshes, walking, jumping, flying and much more. I recommend checking out the GDXR_VRCharacter if you want to learn more.

This however causes its own issues when in vr due to overlapping collisions. For example If a player grabs/holds an interactable object with collisions they overlap with the capsule collider of the character and cause unwanted movement. Essentially bouncing the player around the level.

To fix this we created a custom collision presset. This si why it’s important to set up the DefaultEngine.ini that is provided with the plugin. For more infomation you can view the Setting up the plugin page.

Collision Preset Setup - If you already installed the DefaultEngine.ini

If you havent used the DefaultEngine.ini which comes with the plugin you will need to set this up your self.

If you have installed the DefaultEngine.ini then there is very little to do when creating new interactable actors.

I cant predict how much knowledge you have but if it’s little simply duplicate the exhisting Grabbable_SmallCube blueprint print or The Pistol Blueprint and swap out the meshes and configure the GDXR_GrabComponent as you need.

Setting Up A New Grabbable Actor

Right click in the content broswer and navigate to blueprint class. In then select Actor. This will contain our grabable mesh and components.

This will create an actor for us to use, I’ve named mine BP_Grabbable

Double click to open the actor. In here we will add our mesh/skeletal mesh and set up our grab component.

In this example i’ve gone and added a static mesh of a sphere. (Make sure your static mesh has it’s own collision). If your unsure how to added a statick mesh component to the components list. There is a button above the components list with a green plus and “ADD“. Press this to find it.

I’ve also gone a head and scalled my mesh as the default sphere was to large. After adding the static mesh component you will need to drag it onto the DefaultSceneRoot component. This will make your mesh the new actor root.

Now we have added our mesh as the actors root we need to change the collision preset of the mesh/skeletal mesh were using. This is where the custom Collision Preset “VRInteractable” that we created comes into play. Any interactable actor must use this preset.

With the mesh and collison preset setup correctly we can now add the GDXR_GrabComponent to the mesh. Make sure its a child of the mesh.

If your mesh doesnt fall to the ground when you press play. In the meshes details pannel enable Simulate Physics.