Unreal Interactable Blueprint Setup Guide

1. Getting Familiar with the C++ Components

The interaction system is defined in the C++ with exposed Blueprint functions to further fine-tune the interaction system:

List of relevant C++ classes:

  • GloveController (Actor Component)
    • Forte_Interactor
    • Poses
  • Forte_Interactable (Actor Component)
    • Forte_PickUpObject (Actor Component)
    • Forte_TurnKnob (Actor Component)

2. GloveController and Forte_Interactor

  1. Each GloveController Actor Component contains a Forte_Interactor object.
  2. The GloveController sets up the OverlapBegin and Overlap End callbacks on each of the Finger Capsule Colliders in CreateDataGlove function.
  3. The Finger Capsule Collision Components’ OverlapBegin and Overlap callback functions triggers the Forte_Interactor to add or remove a Forte_Interactable from an available list of grabbable objects.
  4. The Forte_Interactor calculates a grab based on the selected fingers and a grab threshold.
    1. The selected fingers for grabbing and the grab threshold can be set in the Interactable Blueprints if they contain a derived Forte_Interactable Component.
    2. Since Forte_Interactable exposes Setup functions to the Blueprints, other Interactable classes (Forte_PickUpObject, Forte_TurnKnob, etc) inherit and utilize those functions.
  5. When an object is grabbed or released the Forte_Interactable grab events are triggered.

3. Forte_Interactable and Deriving New Interactable Actor Components

The Forte_Interactable is the base Actor Component for deriving other Interactables that require grabbing. For example, Forte_PickUpObject and Forte_TurnKnob inherit properties and functions from Forte_Interactable.

  1. Forte_PickUpObject requires grabbing physics-simulated objects and toggling the Hand Blueprint finger capsule collision components when throwing.
  2. Forte_TurnKnob defines a Knob Actor that acts at the parent actor to the hand when grabbing and rotating the knob.

When creating a new type Forte_Interactable the virtual Grab Events need to be defined in the child class, which are then given specific functionality based on the desired utility of the interactable (such as the 2 examples above).

Below is an example of the EnterGrab and ExitGrab functions defined in Forte_PickUpObject:

4. Poses

  1. The Poses class is an object created in the GloveController.
  2. When a Forte_Interactable object is grabbed the user can optionally add a pose that the hand lerps to.
  3. The are a few sample C++ Poses functions defined already, which can be added to for setting precise finger rotation amounts (0-1.0f).
  4. The Forte_Interactable contains a Blueprint function for setting the grab pose, which the next section will cover.

5. Interactable Blueprints

The Unreal SDK provides some Interactable Blueprints to get started. Some of the Interactable Blueprints like the Button and Lever don’t require adding the Forte_Interactable derived Actor Components, because they don’t require grabbing. These act more as Blueprint examples for showcasing behavior that can be defined when a finger collision component overlaps a collision component in an interactable.

These are located in DataGloveSDK Content/Blueprints/Interactables subfolder:

Functionality that utilizes grabbing behavior can be created by inheriting from the abstract C++ class Forte_Interactable Actor Component. As an example, both Forte_PickUpObject and Forte_TurnKnob utilize a GrabEnter event and GrabExit event to define functionality for interactive behavior.

PickUp_Cube Bluerpint Example Setup:

  1. A Forte_PickUpObject Actor Component is added in the Blueprint Component menu
  2. On BeginPlay event a few setup requirements are added to further define the grabbing behavior
    1. SetFingersUsedToPickup node: sets finger used in grab calculation
    2. Set Pick Up Threshold node: A value between 0 and 0.5 where a higher threshold makes it so a larger bend is needed to trigger the EnterGrab event.
    3. Set Collision Components node: This sets the physics collider component and hover collider component used for grabbing.
    4. Set Pose node: This creates a pose the hand lerps to when grabbing an this specific object.
      1. No Pose
      2. Flat
      3. Fist
      4. Point
      5. Grab
      6. Pinch
      7. Freeze Selected (freezes fingers that are colliding with the object)
      8. Freeze All
    5. Turn on Default Collision Haptics node: turns on haptics when an interactable is touched and when a grabbed object hits another object