Skip to content

Concepts

NIS relies on five core concepts:

  • Interactor Entity that will initiate the interaction
  • Interact Component that receive the interaction
  • Indicator Display indications about the interact
  • Scanner Detect the interacts
  • Slot A physical interface between interactors and interacts

Interactor component

An interactor is the entity that will initiate the interaction
There are two built-in interactors :
- NIS_PlayerInteractor that should be added on your player controller
- NIS_AIInteractor that should be added on the AI pawn

Interactors will run all enabled scanners to search for interacts

Interact component

An interact component will hold the logic of the interaction.
NIS is designed to extend interact classes to create a specific interaction logic. (cf. /Game/Interact/Custom/B_NIS_InteractCustom_Montage)

NIS provides a generic interact NIS_Interact that implements interaction cooldown. There are also other common interactions inheriting from this component:
- NIS_Interact_Delay
- NIS_Interact_Input
- NIS_Interact_Instant
- NIS_Interact_Switch

Requirements

Requirements are simple classes with two functions:
- Check : returns if the interact instance can pass the requirement
- GetText : returns the error message of the requirement

(cf. /NKInteractSystem/Requirement/NIS_B_NIS_Requirementt_NotMoving)

Indicator

An indicator display a visual hint for interactions There are two built-in indicators:
- NIS_B_Indicator_HUD Display actions using the player HUD
- NIS_B_Indicator_World Display actions in the world using a widget component

(cf. /Game/Indicator/B_DemoIndicator_HUD)

Scanner

Scanners runs periodically to detect slots around the interactors.

There are three built-in scanners:
- NIS_B_Scanner_Aim Get the slot aimed by the player
- NIS_B_Scanner_Ground Get slots on the ground
- NIS_B_Scanner_Range Get slots by range

(cf. /NKInteractSystem/Scanner/NIS_B_Scanner_Range)

Slot

Slots are the bridge between interactors and interacts.
You can connect a slot to one or many interacts or having many slots connected to one interact

There are two types of slots: - NIS_MeshSlot for visible slots
- NIS_PhysicSlot for non-visible slots that reacts to physic only
(ex: a plane with a texture could have NIS_PhysicSlot that match an element on this texture)

Actions

An action is used to connect a slot to one or more interact.
The interactor will send the action by TryInteract, then the action will be routed to the specified slots

(cf. /Game/Demo/03-Slot/B_NIS_OneSlot_TwoInteract)