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

Procedural Grip (Part 3)



Purpose: let fingers facilitate on different grap
Go to VR Pawn, viewport,
turn off HMD and R hand visible mesh

To create curve for each finger targets to follow:


Thumb:

Add component “Spline” under MotionControllerLeft , rename as L_ThumbArc
Move the cursor away from the hand
image.png
R click on the line from cursor, Add spline point here

Set the location values from each spline point as follow:
*Remark: select either 1st, last, or next/previous spline point on here:
image.png
Last spline (input key 2.0)
image.png
First spline (input key 0)
image.png
middle spline (input key 1.0)
image.png

Repeat the same for remained 4 fingers by duplicating L_ThumbArc, rename as L_IndexArc...

On IndexArc, drag cursor away from ThumbArc cursor, Add another spline point (i.e. 1 more spline point (4 points) than thumbarc)
image.png
First spline value:
image.png
Last spline:
image.png
Last second spline:
image.png
Second Spline:
image.png

Duplicate L_IndexArc, rename as L_MiddleArc:
image.png
image.png
image.png
image.png

Duplicate MiddleArc, rename as L_ringArc:
image.png
image.png
image.png
image.png

Duplicate RingArc, rename as PinkyArc
image.png
image.png
image.png
image.png

Drag all Arc splines under the lefthand mesh
image.png

Place each arc transform values as below to let the spline snap on correct position on the hand mesh:
image.png

Middle Arc:
image.png
Thumb Arc
image.png
Index
image.png
Ring
image.png
Pinky
image.png

Copy all 5 arc from lefthand mesh, turn lefthand mesh invisible and righhand visible,
then paste in righthand mesh
Rename all Arc from L to R

Tip: if the pasted arc not snap on righthand mesh on correct transform position, use this trick:

1) Copy all the Arcs just like he said in the tutorial (using ctrl+c)
2) move 1 Arc (Shouldn't matter which one) from the left hand to the right hand (it has to be attached there, so if you click on the little triangle next to "RightHand" it should disappear in the components window - click the triangle again now to make it appear again)
3) In the components window, click on the Arc you just attached to the right hand
4) now Paste all the Arcs you copied before (using ctrl+v) with the Arc selected - they should now flip into the right position
5) move the arc you "stole" from the left hand back to the left hand, so that it is attached there, DONE

Programming procedural grip functionality:


Create a variable, type choose Primitive Compenent → Object Reference
image.png
Rename as R_PrimitiveComponent
Duplicate this component, rename as L_PrimitiveComponent

Open Grab Component Event graph,
In Cast to VR Pawn node, drag out to promote variable, rename as VR Pawn
image.png
Drag it to the end to connect to Right Hand Amin
image.png

To let user grab any object that can make procedural hand code works:


Go to Try Grab function, at Orient the held actor to match grabcomponent’s relative location column
Set World location node, add those nodes:
image.png
Drag SET node from Free function to Switch on EControllerHand just created:
image.png

Create Right hand anim as follow to connect to Econtrollerhand:
image.png

Duplicate the new 6 nodes made,
replace:
Right hand anim to left,
object type to Basic left,
and Set Primitive Component to L
Connect to Left on EControllerhand:
image.png

Now whenever user picks up an object, it will set that object as the left primitive component inside VR pawn

To Try Release funtion graph (to unset the object, or else if pick up new objects, won’t be conform again):


At the end of the nodes, add below:
image.png

Create Struct variable (for setup new variables for finger animation system) :


In VR template → Blueprint, R click, structure
image.png
Rename as Finger_Data, open it
Change to Float, add 4 variable, name as below:
image.png

Go to VR Pawn ,add variable, change type to finger Data and name as R FingerData:
image.png

Click compile, should see R Finger Data in Details, and rename Category to ProceduralFingers
image.png
Duplicate R_FingerData variable, rename as L_FingerData

Add a new variable, name as R_FingerCacheThumb, type as array ,vector, Category to proceduralfinger
image.png
Duplicate 4 times and change from thumb to follow:
image.png
Duplicate all 5 again and change from R to L

Add 1 more vairable, set as follow and name as FingerSteps, steps set as 4 after hit complie:
image.png

Click + icon at Functions to create a new function, name as Get Finger Steps
image.png

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.