Now, we're ready to get our hands grabbing these objects.
Setting up VRHand to pick up objects
Creating a function to find the nearest pickup object
The next thing we need to do is find out what objects are near enough to our hand to be picked up. Let's create a function to do this:
- In BP_VRHand, create a new function called FindNearestPickupObject.
- Set its Category to Grabbing and its Access Specifier to Private.
- In its implementation graph, right-click to create a Get All Actors with Interface node, and set its Interface value to BPI_PickupActor.
This is going to give us an array of every actor in the scene that implements the BPI_PickupActor interface.
- Drag a connector from the Out Actors output and create...