Adding a New Controller

Folder Structure

This guide will assume that you are using the folder structured illustrated below. It doesn't matter where you put the CustomController folder but keep in mind that locating it outside of the VRImmersiveHands folder could be better in case you would want to upgrade to a newer version.

  • CustomController

    • MyCustomController

      • Anim

      • Materials

      • Textures

Importing the Mesh (Advanced)

Adding a new controller to the content is rather easy. To add a new controller mesh;

  1. Find the 3D model for the controller. This usually can be found at manufacturer’s website.

  2. Import the 3D model to Blender and make sure scale is correct.

  3. Set units as following.

  4. Separate, rename and parent buttons to Body. Rotate it so forward vector is X+. Name the face button closest to the hand as Button1 and further one as Button2.

  5. Set each button’s pivot properly. Have a look at the Bones of the controller skeletal meshes included in the content for this. A good pivot placement will ease creating pressed button animation. There are tools to only change pivot in Blender. Exporting other skeletal meshes and having a look at them in Blender will help a lot. The 2 most important things are that you get the scale and pivot for the stick right.

  6. Export it.

  7. Import it as Skeletal Mesh and leave Skeleton empty for the first one. If succesful, it will be imported as a Skeletal Mesh and a Skeleton will be created for it. You can use same Skeleton for Left and Right meshes.

  8. Add hint sockets. Have a look at the provided controllers.

  9. Create a mask for every button. Have a look at the provided controllers.

Creating Animation Assets (Advanced)

  1. Open the Skeletal Mesh and Create Animation from Current Pose. Name it as Anim_XXX_Idle. Where XXX is the name of the controller.

  2. Duplicate Anim_XXX_Idle and name it as Anim_XXX_Pressed.

  3. Open Anim_XXX_Pressed, click To Front on timeline and set each button’s transform as though they are pressed. Have a look at other pressed anims for reference. Click Key and Apply after every button so you don’t lose progress. Click Apply and Save when its done.

  4. Create an Anim BP.

  5. Add BPI_AnimBP to the Anim BP.

  6. Copy the Interface Events from another AnimBP. Delete the one that your controller doesn’t have.

  7. Copy the Anim Graph nodes from another AnimBP. Change Idle and Pressed anims with new ones. Delete the one that your controller doesn’t have. Make sure bone names are correct in Layered Blend Per Bone.

  8. Modify the Stick 2D part so that X=1, Y=0 tilts the stick on Y+ axis and X=0, Y=1 tilts the stick on X+ axis.

Adding it to the Data Table (Advanced)

  1. Open E_HMD and add a new enumerator.

  2. Open DT_Controllers and add a new row. Warning: This have to be same with the one entered in E_HMD.

  3. Fill out hand properties. We will come back to Hand Transform.

Settings

Description

Left Controller

A skeletal mesh for displaying as left controller

Left Anim BP

An anim instance for left controller

Right Controller

A skeletal mesh for displaying as right controller

Right Anim BP

An anim instance for right controller

LC Optimized

A static mesh for displaying as left controller

RC Optimized

A static mesh for displaying as right controller

Hint Material L

Hint Material R

Hand Transform

Transform for UE4 hand to grab the controller. Hand Animations

Hand Animations (Advanced)

Here comes the hard part. This part will take a long time and patience. You can use Control Rig to create these animations.

  1. Utilize the Using Control Rig - Advanced Level and Bake To Control Rig to create animations.

  2. Open DT_ControllerAnims, add a new row and fill out animations. Warning: This have to be same with the one entered in E_HMD.

Hint Setup

If you want to show hints on your buttons follow these steps. Have a look at the provided controllers for example.

Material Order in the Hint Material Arrays

  • MI_Hologram_MyCustomController

  • MI_Hologram_MyCustomController_Culling

  • MI_Hologram_MyCustomController_DDT

  • MI_Hologram_MyCustomController_Culling_DDT

  • MI_Highlight_MyCustomController

Hologram Materials

  1. Duplicate materials named with MI_Hologram... to your custom hands materials folder.

  2. Create finger masks for you custom hand.

    1. T_MyCustomController_B1_B2_S. B1=Button1 as R, B2=Button2 as G, S=System as B.

    2. T_MyCustomController_M_SH_P. M=Menu as R, SH=Shoulder as G, P=Touchpad as B.

    3. T_MyCustomController_T_G_TS. T=Trigger as R, G=Grip as G, TS=Thumbstick as B.

  3. Set the sRGB value of the masks to false in UE4.

  4. Replace the masks with yours.

Highlight Material

Duplicate your hands material and add this setup to it.

Update Button Functions (Advanced)

Go through each Update Button for each controller button.

Input Mappings

Check if your controller’s inputs are mapped in “Project Settings>Input”. If they are not, add them.

Last updated

Was this helpful?