HomeModule plugins › AFM_Abilities
Module

AFM_Abilities

The architectural root of the framework: the ability and interaction base classes, sockets, Source Info, haptics and the actor registry. Almost everything else depends on this plugin.

What it gives you

  • The four base classes every interactive system is built from
  • The blocker activation model
  • Source Info, the identity struct passed through every interaction
  • Haptics helpers that resolve to the correct hand automatically

Requires

AFM_AutoDestroy AFS_Core_Highlight

Required by

AFE_Showroom AFM_Teleport AFM_WidgetInteraction AFS_Core_Pawn AFS_Core_Snapping AFS_UI AFS_UISpace_Hand AFS_UISpace_Pawn AFS_UX_Gaze AFS_UX_Grip AFS_UX_Laser AFS_UX_Locomotion AFS_UX_Overlap AFS_UX_Select AFS_UX_Teleporter AF_Examples

28 assets69 API members

Description

This is the plugin to understand first. It defines no gameplay of its own — it defines the contract everything else follows.

Four component base classes cover the possible places an interaction can originate or land. BPC_PawnAbility sits on the pawn and represents something the player can do as a whole. BPC_ControllerAbility sits on a motion controller and represents something one hand can do. BPC_ActorAbility covers abilities on non-player actors. BPC_Interaction sits on the target and declares what may be done to it.

The design goal is that a target object never knows what kind of player is acting on it. It receives ST_SourceInfo — pawn, component, identifier — and that is enough to distinguish left hand from right, or one ability from another, without referencing a single pawn or controller class. That one decision is what makes the same content work in VR, on desktop and on mobile.

Activation is managed through blockers rather than booleans. See The blocker system for why, and for the pitfalls.

Setup

This plugin is a dependency rather than something you configure. It is enabled by every UX plugin and by the pawns.

  1. Enable AFM_Abilities alongside AFS_Libraries.
  2. Nothing else is required — the base classes become available to derive from and the libraries appear in the node palette.
Note

You will rarely add these base components to an actor directly. You add the concrete subclasses that the UX plugins provide, such as BPC_Interaction_Select or BPC_PawnAbility_Grip.

Usage

Suppressing an ability

Call SetActiveWithBlocker (controller and actor abilities) or SetBlockerAndCheckActive (pawn abilities) with a reason name. Call again with the same reason and false to release.

Suppressing a whole class of abilities

Call setAbilityRestriction on the pawn with a component tag. Every ability on the pawn and on both motion controllers carrying that tag is suppressed under your reason, in one call. This is how the menu disables movement while it is open.

Giving one ability exclusive use of a hand

Call MC_SetFocusControllerAbility on the motion controller with the ability that should keep running. Everything else on that hand is blocked with the reason Unfocussed.

Playing haptics

Call FL_Haptics.Haptics_Effect with the Source Info you received. It resolves the correct hand itself, and does nothing on platforms without haptics — no branching required.

Reading who acted on you

Every interaction call gives you Source Info. getSidesFromAbility turns it into one hand or both; the Identifier field distinguishes abilities of the same type.

Key properties

PropertyOnWhen to change
IdentifierAll abilitiesSet when a target needs to distinguish this ability from another of the same class — a fingertip versus a whole hand, for example
BlockersAll abilitiesNever edit directly; use the blocker API so reasons are tracked
Relevant ComponentsBPC_InteractionWhen only some of the actor's meshes should be interactive
Highlight ClassBPC_InteractionChoose the highlight style; leave empty for no hover feedback
Highlight TagBPC_InteractionWhen only some meshes should highlight
Default Interaction StateBPC_Pawn_InteractionStateTo change the resting cursor and accent colour

Extending

Derive from BPC_Interaction to add a new interaction type, and pair it with an interface exposing a CanBe… function that returns an override flag and an answer. Call TickHighlight while hovering and highlighting works for free.

Derive from BPC_PawnAbility or BPC_ControllerAbility for new abilities. Override ComponentActivated and ComponentDeactivated to add and remove your input mapping context — doing it there means the blocker system manages your input automatically.

See Extending the framework for the full pattern.

Example map

No dedicated map — every UX example map exercises this plugin. Map_Examples_Select is the smallest complete demonstration.

Troubleshooting

An ability stopped responding and nothing changed. A blocker was added and never removed, almost always because the release call used a different reason name. Inspect the ability's Blockers array at runtime; it lists exactly what is holding it down.

My interaction never highlights. Highlight Class is empty, or the actor's meshes do not carry Highlight Tag. Leave the tag empty to highlight everything.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_ActorAbility4 members
extends ActorComponent · implements BPI_Ability, BPI_SourceInfo
KindNameSignatureDescription
varIdentifierIdentifiernameName used to identify this ability when it is reported through Source Info, so interaction targets can tell which ability acted on them. Leave as None if the ability does not need to be distinguished from others on the same actor.
varBlockersBlockername[]Live list of reasons this ability is currently suppressed. The ability is active only while this list is empty; entries are added and removed through Set Active With Blocker rather than edited directly.
fngetAllAttachedActorsAbility(out Actors: Actor[])Returns every actor this ability currently owns or has attached to itself. Override in a child ability that spawns actors so the owning motion controller can collect them.
fnSetActiveWithBlockerBlocker(Set: bool, Reason: name)Suppresses or releases this ability under a named reason. Multiple systems can block the same ability independently; it only reactivates once every reason has been removed.
BPC_AttachmentRegistry4 members
extends ActorComponent
KindNameSignatureDescription
fngetRegisteredActorsRegistry(Attached: bool, NonAttached: bool, out Actors: Actor[])Returns the actors registered with this owner, filtered by whether they are currently attached, not attached, or both.
eventRegisterActor(Actor: Actor, Attached: bool)Adds an actor to this owner's registry and records whether it is attached. The registry automatically drops the actor again when it is destroyed.
eventOnDestroyed_Event(DestroyedActor: Actor)Internal handler that removes a registered actor from the registry when that actor is destroyed.
eventUnregisterActor(Actor: Actor)Removes an actor from this owner's registry.
BPC_ControllerAbility6 members
extends SceneComponent · implements BPI_Ability, BPI_SourceInfo
KindNameSignatureDescription
varIdentifierIdentifiernameName used to identify this ability when it is reported through Source Info, so interaction targets can tell which hand or ability acted on them.
varBlockersBlockername[]Live list of reasons this ability is currently suppressed. The ability is active only while this list is empty; entries are added and removed through Set Active With Blocker rather than edited directly.
fngetAllAttachedActorsAbility(out Actors: Actor[])Returns every actor this ability currently owns or has attached to itself, so the motion controller can gather everything it is carrying.
fnSetActiveWithBlockerBlocker(Set: bool, Reason: name)Suppresses or releases this ability under a named reason. Used by other abilities to take exclusive control of a hand without permanently disabling what they interrupted.
eventInitiateControllerAbility(Pawn: Pawn, MotionController: Actor, Side: E_Side)Called by the motion controller once it has been spawned, handing the ability its owning pawn, controller actor and hand side. Extend this to run setup that needs to know which hand it belongs to.
eventSetVisible(Set: bool)Shows or hides this ability's visual representation without deactivating its logic.
BPC_Interaction12 members
extends ActorComponent
KindNameSignatureDescription
varRelevantComponentsConditionsnameComponent tag limiting which of the owner's primitive components respond to this interaction. Leave empty to make every primitive component of the actor interactive.
varHighlightClassHighlightClass<BPC_Highlight>Highlight component spawned on demand when this interaction is hovered. Choose the material, mesh-copy or post-process variant depending on how the object should read; leave empty for no highlight.
varHighlightColorHighlightLinearColorColour passed to the highlight component when it is created. Use it to signal interaction type or state, for example a warning colour on a locked object.
varHoverSoundHighlight|SoundSoundBaseSound played once when this interaction starts being hovered.
varUnhoverSoundHighlight|SoundSoundBaseSound played once when hovering over this interaction ends.
varBlockersBlockersname[]Live list of reasons this interaction is currently suppressed. The interaction responds only while this list is empty.
varHighlightTagHighlightnameComponent tag passed to the highlight component to limit which meshes are highlighted. Leave empty to highlight every mesh on the actor.
fnSetBlockerBlocker(Set: bool, Reason: name)Suppresses or releases this interaction under a named reason, so several systems can disable it independently without overriding each other.
fngetRelevantSocketComponentsInternal(SocketClass: Class<BPC_Socket>) → SceneComponent[]Returns the sockets of the given class that this interaction is allowed to use, honouring the Relevant Components tag filter.
eventTickHighlight(SourceInfo: ST_SourceInfo, TraceResult: HitResult)Called every frame while an ability is hovering this interaction. Keeps the highlight alive and broadcasts On Highlight Tick; highlight ends automatically when the calls stop.
eventOnDestroyed_Event_0(DestroyedActor: Actor)Internal handler that deactivates this interaction when its owning actor is destroyed.
eventUpdateHighlightColor(HighlightColor: LinearColor)Changes the highlight colour at runtime and pushes the new colour to the active highlight component.
BPC_PawnAbility4 members
extends ActorComponent · implements BPI_Ability, BPI_SourceInfo
KindNameSignatureDescription
varIdentifierIdentifiernameName used to identify this ability when it is reported through Source Info, so interaction targets can tell which ability acted on them.
fnSetBlockerAndCheckActiveBlockers(Set: bool, Reason: name)Suppresses or releases this ability under a named reason and re-evaluates whether it should be active. The ability runs only when no reasons remain.
eventPossess(Pawn: Pawn)Called when the owning pawn is possessed. Caches the pawn, resolves its platform type and lifts the Unpossessed blocker so the ability can start running.
eventUnpossess()Called when the owning pawn is unpossessed. Re-applies the Unpossessed blocker so the ability stops until the pawn is possessed again.
BPC_Pawn_InteractionState4 members
extends ActorComponent
KindNameSignatureDescription
varDefaultInteractionStateSettingsPDA_InteractionStateInteraction state the pawn falls back to when nothing is being hovered. Defines the resting cursor and accent colour.
fngetCurrentColor(out Value: LinearColor)Returns the accent colour of the interaction state currently in effect, so UI and highlights can match the active interaction.
eventSetInteractionState(Style: PDA_InteractionState, Reference: Object)Requests an interaction state for this frame. The highest-priority request wins, and the state reverts to the default shortly after requests stop arriving.
eventApplyInteractionState(CurrentInteractionState: PDA_InteractionState, Reference: Object)Applies an interaction state immediately, swapping the mouse cursor and cursor widget. Prefer Set Interaction State so priority and fallback are handled for you.
BPC_Socket1 members
extends SceneComponent · implements Interface_Socket
KindNameSignatureDescription
varSocketNameSocketnameName of this socket. Grip and attachment logic matches sockets by name prefix, so keep the prefix consistent with the socket type you are implementing.

DataAssets

PDA_InteractionState4 members
extends PrimaryDataAsset
KindNameSignatureDescription
varPriorityPriorityintRanking used when several systems request an interaction state in the same frame. The highest value wins.
varColorStyleLinearColorAccent colour associated with this interaction state, used by highlights and UI to signal what kind of interaction is available.
varMouseCursorMouseEMouseCursorHardware mouse cursor shown while this interaction state is active, on desktop targets.
varMouseCursorWidgetMouseClass<WBP_MouseCursor>Optional widget drawn in place of the hardware cursor while this state is active, for a cursor that matches your project's styling.

Helper

BP_Helper_ControllerAbility1 members
extends Actor
KindNameSignatureDescription
varSideE_SideHand this helper actor belongs to. Set when the owning controller ability spawns the helper.

Interfaces

BPI_Ability1 members
extends Interface
KindNameSignatureDescription
fnAbility_getOwningPawnAbility(out Pawn: Pawn)Returns the pawn that owns this ability, regardless of whether it sits on the pawn, on a motion controller or on a player controller.
BPI_AbilityRestriction1 members
extends Interface
KindNameSignatureDescription
fnsetAbilityRestrictionAbility Restriction(AbilityTag: name, Set: bool, Reason: name)Suppresses or releases every ability carrying the given tag, under a named reason. Implemented by pawns so one system can disable a whole class of abilities at once, for example blocking movement while a menu is open.
BPI_MotionController4 members
extends Interface
KindNameSignatureDescription
fnMC_SetFocusControllerAbilityMotion Controller(ControllerAbility: BPC_ControllerAbility, Set: bool)Gives one ability exclusive use of this controller by blocking all the others, or releases that exclusivity again.
fnMC_GetAllAttachedActorsMotion Controller(out Actors: Actor[])Returns every actor currently held or spawned by any ability on this controller.
fnMC_SetControllerVisibilityMotion Controller(const Set: bool)Shows or hides the controller's visual representation, for example to hide a hand mesh while an object is held.
fnMC_getMotionControllerSideMotion Controller(out Side: E_Side)Returns which hand this controller represents.
BPI_MotionController_Hands7 members
extends Interface
KindNameSignatureDescription
fnMCHands_SnapToSocketMotion Controller Hands(Socket: ST_Socket)Snaps the hand mesh onto the given socket, so a held object determines the hand's position and pose.
fnMCHands_getGrabWorldTransformMotion Controller Hands(out Transform: Transform)Returns the world transform of the hand's grab point, the position objects are picked up relative to.
fnMCHands_SetHandCollisionMotion Controller Hands(Collision: ECollisionEnabled = "NoCollision")Changes the collision mode of the hand mesh, for example disabling collision while an object is being carried.
fnMCHands_getCurrentSnapSocketMotion Controller Hands(out Socket: ST_Socket)Returns the socket the hand is currently snapped to, or an empty socket if the hand is free.
fnMCHands_isHandOpenMotion Controller Hands(out Open: bool)Returns whether the hand is currently in an open pose, used to decide whether an object can be released or auto-gripped.
fnMCHands_SetPoseMotion Controller Hands(HandPose: AnimSequenceBase)Applies a hand pose animation, typically the custom grip pose defined on the object being held.
fnMCHands_GetPoseMotion Controller Hands(out HandPose: AnimSequenceBase)Returns the hand pose currently applied.
BPI_PawnInfo3 members
extends Interface
KindNameSignatureDescription
fnInterface_getCameraPawn Info(out Camera: SceneComponent)Returns the pawn's camera component, so abilities can work from the view direction without knowing the pawn class.
fnInterface_getPawnTypePawn Info(out PawnType: E_Pawn_Type)Returns whether this pawn is the VR, desktop or mobile variant, so shared abilities can branch on platform.
fnInterface_RecenterCapsulePawn Info()Moves the collision capsule under the player's current head position without moving the tracked camera. Called after locomotion so the capsule follows real-world walking.
BPI_SourceInfo2 members
extends Interface
KindNameSignatureDescription
fngetSourceInfoSource Info(out SourceInfo: ST_SourceInfo)Returns the Source Info describing this ability: the owning pawn, the component acting, and its identifier. Passed into every interaction so targets know who is acting on them.
fnsetSourceInfoSource Info(SourceInfo: ST_SourceInfo)Stores Source Info on this object, used by helper actors that need to remember which ability created them.
BPI_WidgetInteraction2 members
extends Interface
KindNameSignatureDescription
fnWidget_SetWidgetInteractionComponentWidgetInteraction(WidgetInteractionComponent: WidgetInteractionComponent)Assigns the widget interaction component this object should route pointer events through.
fnWidget_GetWidgetInteractionComponentWidget Interaction(out WidgetInteractionComponent: WidgetInteractionComponent)Returns the widget interaction component currently driving pointer events for this object.
Interface_Socket1 members
extends Interface
KindNameSignatureDescription
fnSocket_getSocketName(out Name: name)Returns this socket's name, used to match sockets against the prefix an ability is looking for.

Libraries

BFL_ActorRegistry3 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnRegisterActorRegistry(Parent: Actor, Actor: Actor, Attached: bool, __WorldContext: Object)Registers an actor against a parent actor and records whether it is attached. Use this to track spawned or carried actors without holding hard references.
fnUnregisterActorRegistry(Parent: Actor, Actor: Actor, __WorldContext: Object)Removes an actor from a parent actor's registry.
fngetRegisteredActorsRegistry(Parent: Actor, Attached: bool, NonAttached: bool, __WorldContext: Object, out Actors: Actor[])Returns the actors registered against a parent, filtered by attachment state.
FL_Haptics4 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnHaptics_EffectHaptics(SourceInfo: ST_SourceInfo, HapticEffect: HapticFeedbackEffect_Base, __WorldContext: Object)Plays a one-shot haptic effect on the hand or hands that the given Source Info came from. Does nothing on platforms without haptics.
fnHaptics_ContinousHaptics(SourceInfo: ST_SourceInfo, const Frequency: float = 0.5, const Amplitude: float = 0.5, __WorldContext: Object)Starts a continuous rumble at the given frequency and amplitude on the hand the Source Info came from. Must be stopped explicitly with Haptics Stop.
fnHaptics_StopHaptics(SourceInfo: ST_SourceInfo, __WorldContext: Object)Stops any continuous haptic feedback running on the hand the Source Info came from.
fngetSidesFromAbilitySides(Ability: ActorComponent, __WorldContext: Object, out Sides: E_Side[])Returns which hands an ability is associated with. A controller ability resolves to its own hand; a pawn ability resolves to both.
ML_Actor_Input0 members
extends Actor

No editor-visible members; this asset configures defaults only.

ML_Actors_Haptics0 members
extends Actor

No editor-visible members; this asset configures defaults only.

ML_Comp_Input0 members
extends ActorComponent

No editor-visible members; this asset configures defaults only.

ML_Component_Haptics0 members
extends ActorComponent

No editor-visible members; this asset configures defaults only.

ML_ControllerAbilities0 members
extends BPC_ControllerAbility

No editor-visible members; this asset configures defaults only.

ML_Helper_ControllerAbility0 members
extends BP_Helper_ControllerAbility

No editor-visible members; this asset configures defaults only.

ML_Object_SourceInfo0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_PawnAbility0 members
extends BPC_PawnAbility

No editor-visible members; this asset configures defaults only.

Widgets

WBP_MouseCursor1 members
extends UserWidget
KindNameSignatureDescription
varReferenceObjectObject that requested this cursor widget, available so the cursor can reflect what is being pointed at.