Story Framework 6 is now live! Find more info here.
Story Framework Documentation

Setting up an Interaction

Check out Interaction in a Nutshell if you'd prefer to watch a video tutorial covering interaction.

Video tutorial coming soon!


All interactables/interactions implement the SFInteraction_BPI blueprint interface to communicate certain functions to and from interactables. This includes an interactables InteractionData_S structure. The following points will continue to elaborate on these settings.


1

Level Actor

Firstly, we will need to place an actor in the scene that your interaction will be connected to. The easiest approach would be to place the InteractableBase_BP actor into your level (SF > Core > Gameplay > Interaction)

2

Appearance and Collision

Now that we have an actor in the scene representing our interaction, we might want to add scene components (like a mesh for instance) to our interactable. If you're using the InteractableBase_BP actor, this can be done by simply hitting the "Add" button in the details panel with your actor selected. Here, you can add any component (static mesh, skeletal mesh, particles, etc) you'd like to this actor.

In regards to interaction collision, you'll notice the InteractableBase_BP already contains a blue tinted sphere collider. This collider is exclusively used to block the players interaction trace, meaning players are not forced to look directly at your actors mesh to interact with it. The size of this sphere can be modified by clicking on the InteractionCollision component in the details panel, or alternatively modifying the Interaction Collision Size variable under "Data" in the details panel with your interactable selected.

3

Setting General Data

All interactions utilize General Data. This is where you define the ID of your object, it's display name, and other useful initial values.

Object ID Its generally good practice to always give unique interactables their own unique ID, however there are some interaction scenarios that this isn't required. Object Display Name The localizable text name of your interactable, primarily used to display through widgets. Interaction Distance The distance (From player camera to object, in Unreal Units) at which the player can interact with this object. The interaction system does not use a fixed interaction distance. Instead, each interactable can contain its own unique interaction distance. Input Hold Timer How long the player is required to hold the Primary Interact Key before interaction is executed. Leaving this value at "0,0" means an interaction happens immediately upon key press. Quick Action Triggers Check out the Quick Actions section for more info.

4

Configuring Advanced Data

Advanced Data is where we can begin to define more interesting and specific interaction behaviours for our object. Let's approach this by comprehending the different interaction layers/phases first and foremost. Upon executing an interaction, the execution flow looks a little something like; Interact > Execute "On Interact" Quick Actions > If Required Item ID is not empty, then execute "Player Requires Item" layer > Execute Interaction Method logic. The flow mentioned above should help with understanding when and where values are used.


Defining the baseline behaviours are done through the 3 variables shown below,

Interaction Execution Order This option should generally be set to its default value (Execute Interaction Method Logic Immediately). If you're setting up a custom interactable and have custom logic assigned to your custom interactables EventPrimary/SecondaryInteractWith BPI function that you'd like to execute before interaction method logic mentioned below, then use the Manually Execute Interaction Method Logic option. Primary Interaction Method The type of interaction to execute upon "Primary Interacting" with your interactable. Interaction types included out-of-the-box are: None/Custom, Inspect, Drag, Physics Grab, and Quick Pickup. Secondary Interaction Method (Optional) This is an optional secondary interaction that can be utilized. The available interaction methods here are: None, Custom, Inspect, and Quick Pickup. Each interaction method contains its own drop-down within "Advanced Data". This is where you specify how a specific interaction method will execute or behave. Make use of the tooltips that appear when hovering a variable to learn more about how each variable effects an interaction.

5

Managing Prompt Data

Control how your interactables prompt appears and behaves through the Prompt Data section.

Prompt Widget Override Override the "Default" prompt widget assigned in the "Story Framework Values" data asset. Widget Data String (Optional) If you'd like your "Prompt" widget to have custom logic per interactable object, then this is where you can assign a custom "Data String" for this objects "Prompt" widget specifically. Primary Interact Text Override Override the default "Primary Interact" text displayed on "Prompt" widgets provided with SF out-of-the-box. Secondary Interact Text Override Override the default "Secondary Interact" text displayed on "Prompt" widgets provided with SF out-of-the-box. Prompt Fade in Distance The distance at which this objects interaction indicator (indicator is included in any "Prompt" widget) and the prompt in its entirety begins to be visible (in uu). Object Outline Color Optionally override SF's outline color assigned to this object specifically.

6

Inspect Focus Points (Extra Feature / Optional)

SF includes a scene component that can be added to any interactable to add further depth to inspection interactions. This adds an interaction on your physical object that is accessible during inspection. To add an Inspect Focus Point to your interactable, hit the button in the components hierarchy field within the details panel with your interactable selected (this can also be added to your interactables component hierarchy inside of a custom child blueprint so that every instance of your child interactable contains it without needing to manually add it in the details panel with your interactable selected in the level viewport) and search for the FocusPoint_BP component.

With your FocusPoint_BP component selected, you'll find general properties for defining a static mesh to appear as well as adjust its position (contains a blue outlined "handle" to move the mesh in the scene instead of modifying the offset values in the details panel)

Interaction Type will define the result of an interaction with your focus point.

None Simply executes this focus points "On Interact Quick Actions" and display any readable if setup. Nothing further. Destroy Focus Point Executes the same behaviour as "None", but immediately "destroys / removes" this focus point and its static mesh. Useful for one-time focus points. Stop Interaction For Duration Executes the same behaviour as "None", but will disable interaction with this focus point for a few seconds at which point it will be re-enabled.

Focus Points inherintly support readables upon interaction. You can define what data appears in the readable widget under the Readable Data (If Readable) section. Uncheck Open Readable on Interact to disable the readable popup for this focus point.

Adjusting the location of where the interaction prompt appears can be done by modifying the offset values of the Interaction Prompt Offset value (contains a blue outlined "handle" to move the prompt offset in the scene instead of modifying the offset values in the details panel).


Export to PDF