Avatar Authoring - Interactions
How to set up Avatar Interactions.
Interactions are arbitrary actions that are bundled with your avatar. Interactions can:
- Play animations on your avatar.
- Toggle bones on your avatar.
- Trigger arbitrary Blueprint script.
- And more!
If you want to switch your avatar between different states (such as different poses), consider using Stances instead.
Interactions automatically get a button in the kemorig HUD, and can have hotkeys assigned to them.
Initial Setup
Create a DataTable for Interactions
Interactions are defined in a DataTable with row struct KemorigSoloInteractionTableData.
We can create a new one, but let’s copy a blank example DataTable included with the project.
In the content browser, navigate to the folder KemorigExampleContent Content/Data/Interactions/ and find Blank_Interactions. Copy/Paste a copy of this into our avatar folder (I like to use MyCharacter/Interactions/) and rename it.
Reference DataTable in Avatar Blueprint
Open your avatar blueprint and navigate to the Class Defaults.
In the Interactions category, reference your DataTable in the field Avatar Interactions.
This is all we need to do to enable Interactions. Now, any rows we add in the DataTable will create a new Interaction we can use in kemorig.
Adding a New Interaction
Open your interactions DataTable.
Click the Add button at the top to add a row.
This row defines the Interaction:
- The Row Name is the name you’ll use to refer to the Interaction in Blueprints.
- The properties visible when you select the row define the Interaction’s behavior.
Interaction Types
Interactions can be one of 3 Types:
- One Shot - fire and forget, does the same thing every time it’s triggered.
- Toggle - has an on and off state.
- Multi Interaction - an Interaction that triggers other Interactions. Has these options:
- Random
- In Order
- All at Once
Built-In Features
Interactions have a few built-in features. These are controlled by filling out parameters in the DataTable.
Play Animations
One Shot and Toggle Interactions can play animations on your avatar.
It does this using “Animation Slots”. For more information, see this page in Unreal’s documentation: Animation Slots
Be sure to use the Animation Slot Name property in the Interaction to designate what slot animations play in.
Toggle Bones
Toggle Interactions can toggle bones on your avatar mesh on or off.
You can enter either a bone name or a socket name (if you’ve added sockets to your skeleton).
Custom Behavior
Interactions allow you to run arbitrary blueprint logic using events. In any blueprint (often your avatar blueprint), you can bind handlers to Interactions by-name.
To explore what you can do:
- Open your avatar blueprint and go to the Event Graph.
- Add a Get Kemorig Interaction Subsystem node to your blueprint.
- Drag the pin out of it and search for “Kemorig Interactions” functions.