Creat BP interface, called Grab
Create 2 functions: Grab and Release, both create input: Motion Controller
Also add a function named Interact (to turn on/off light)
BP actor called Flashlight:
to Class setting, add grab interface
Event graph:
Double click all 3 interface to create their nodes
Event interact (if spot light is on, the light will be visible; and if the flash is on, untick new visibility mean next action is to turn it off)
in VR pawn:
Grab left node, for Pressed
(set nearby actor overlap to controller, will perform Grab interface)
promote variable(left grab actor) from above reroute node (grab message node, with a envelop at cotner) is to send message telling grab is functioning):
For Release,
Convert to validate of Left Grab actor variable, use release message node as well:
Duplicate on Grab right node and replace follow:
For trigger nodes (turn on off light)
Dim down the light in scene, drag the flashlight BP to test