Hand Functions

Add VR hand and Anim to VR Pawn (Part 1)

Simlpified version (without using Eumin):




Open a VR template (without starter content)
In project setting, set Default RHI to DirectX 11 (prevent crash of this project) → Restart
image.png

Create new asset folder, import hand models and animation:


Import animation setting: Skeleton QK_Custom..., untick import mesh
image.png
if can’t import anim, in animation length, Set Range and set frame Import Range from 0 to 5 on import window

For AORM texture with RGB in material, connect as AO by Red, R by Green, M by Blue:
image.png

To create left and right hand input command:


Project Setting → Input → Binding
image.png
click + icon next to Action mapping twice to add 2 new mappings:
Rename as R, L thumb ANIM, choose oculus touch A and B, then X and Y
image.png


Assign hand mesh, controller and anim to VR pawn:


Open the VR pawn, Viewport → make HMD mesh invisible
Select Motion Control Right, add component: Skeletal Mesh (rename as RightHand)
image.png
choose QK hand in Details of Mesh:
image.png

Set the location, rotation and scale at following reading (fit the real life hand grab position)
image.png

Repeat the same steps for left hand controller, except the transform data change to below
image.png

Go to both MotionController Left and Right, Visualization, untick Display Device Model (to hide controller in VR view)
image.png

Create animation BP:


R click on QK hand mesh, create → Anim BP, rename as BP_HandAmin, open it
image.png
In VR template → BP, R click , BP, Enumeration, rename as Enum_HandAmin, open it
image.png
click +add Enumerator 5 times, rename them as open, grip, pointing, thumbup, objecthold,
also name enum desctiption as Enum For Hand Pose Animation
image.png
Create another Enummeration, rename as Enum_ObjectType, add 5 times also and name as below:
image.png

Go to Hand BP for state machine:


Add following 2 variables:
image.png
Create a state machine name as HandAnimations, open it
→ in Entry, add state, name as Open → open it
drag QK open anim and collect:
image.png
back to HandAnimations, add new state name as Grip, repeat the same anim drag step
double click the transition icon between Open and Grip state:
image.png

Drag Handstate variable in graph,type == to get Equal (Enum) node
image.png
connect as follow:
image.png

then copy 1st two nodes, open reverse transition from Grip to Open, paste the copied nodes in reverse transition. change grip to open:
image.png
image.png

Add Thumbsup State, repeat the same steps in their transitions:
image.png

From grip to thumbsup transition:
image.png
From Thumbsup reverse to grip transtion:
image.png

For Pointing state:
image.png
image.png

After Thumbsup and pointing set, drag pointing state back to grip:
Open its transition, set as follow:
image.png
Create the Reverse from grip to pointing:
image.png

Drag Open to Pointing:
image.png
image.png

Drag Open to thumbsup:
image.png
Reverse:
image.png

So the basic animation setup becomes:
image.png


From Open state, add Object State, open it and drag Anim QK Grip:
image.png
Open it transition, put objecthold this time:
image.png
reverse its transtition:
image.png
image.png

To add Anim in VR pawn:


Go to VR pawn, viewport, select LeftHand mesh on Component → Change Anim Class and mode:
image.png
Repeat the same on RighHand

Go to Evnet Graph → Event Begin node, set BP as follow:
image.png
Rename set node (from promote variable) as LeftHandAnim, name category as HandAnimations
image.png

Repeat the same on Right Hand,
Command as VR hand Animation Setup, connect back to begin play Branch:
image.png

Set different Boolean to let Anim BP determine which anim state to set the hand into when we press specific button:


Keep in event graph, add variable (Boolean), name as RightGripAnim, category choose HandAnimations
Duplicate it, rename as RightPointAnim
Duplicate again, reaname as RightThumbAnim
Repeat the same as LeftGrip...
image.png

Go to the most bottom blank space in event graph, create nodes as follow by dragging and Set the boolean above :
image.png

Go to InputAction TriggerLeft/Right nodes (default there), drag Point Boolean in them:

image.png

Go to InputAction Grab Left nodes (also default there), place Grab boolean in between:
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.