HomeSystem plugins › AFS_UX_Select
System

AFS_UX_Select

Selection by fingertip, laser or desktop click, with priority resolution and interface-based vetoes.

What it gives you

  • One interaction that works with mouse, laser and fingertip
  • Priority resolution when objects overlap
  • Hit-location override for precise pointing

Requires

AFM_Abilities AFM_WidgetInteraction AFS_Libraries

Required by

AFE_Showroom AFS_UX_Grip AFS_UX_Laser AFS_UX_Teleporter AF_Examples

8 assets21 API members

Description

Select is the smallest complete interaction stack in the framework and the best one to read when learning the pattern.

BPC_PawnAbility_Select traces from the pawn and resolves the highest-priority selectable component under the cursor. BPC_Interaction_Select on the target declares selectability and fires On Select. Interface_Select on the owning actor can veto, or redirect where a pointer appears to hit.

The same interaction serves all three input methods, because the ability supplies the trace and the target only cares about the resulting Source Info.

Setup

  1. Enable AFS_UX_Select.
  2. Confirm BPC_PawnAbility_Select is on the pawn, and BPC_ControllerAbility_Hand_Laser or _Hand_Finger on the motion controllers for VR.
  3. Add BPC_Interaction_Select to any actor and bind On Select.

Usage

Basic selection

See Make an object selectable.

Vetoing

Implement Interface_Select and return Override = true with Is Selectable = false.

Redirecting the pointer

Implement Select_HitLocationOverride to make a laser terminate at a chosen point rather than the raw trace hit — useful for snapping to a control's centre.

The object selected in play, highlight active
AFS_UX_Select_result.pngThe object selected in play, highlight active
The object selected in play, highlight active

Key properties

PropertyWhen to change
Select SoundFeedback on selection
Relevant ComponentsRestrict which meshes are clickable
Select Interaction StyleThe cursor and accent colour shown while hovering something selectable
Min / Max Laser LengthOn the laser ability, to change reach

Extending

Copy this stack's shape when adding your own interaction type — it is the reference implementation. See Extending the framework.

Multiplayer notes

Multiplayer

BPC_Interaction_Select implements IOutsidePawnRPCInterface, so selection replicates without routing through the pawn. Requires AFPNetDriver.

Example map

Map_Examples_Select covers click, laser and fingertip selection with vetoes.

Troubleshooting

Nothing is selectable. The pawn is missing BPC_PawnAbility_Select, or the object's meshes have no collision on the trace channel.

API reference

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

Components/ControllerAbilities

BPC_ControllerAbility_Hand_Finger1 members
extends BPC_ControllerAbility
KindNameSignatureDescription
varTrace DistanceSettingsfloatHow far ahead of the fingertip the selection trace reaches.
BPC_ControllerAbility_Hand_Laser7 members
extends BPC_ControllerAbility
KindNameSignatureDescription
varMinLaserLengthSettingsfloatShortest the laser is drawn when it hits something close by.
varMaxLaserLengthSettingsfloatMaximum reach of the selection laser.
varMapping Contexts DefaultInputST_MappingContext_SideInput mapping contexts applied for the left and right hand.
varThicknessSettingsfloatThickness of the laser beam.
varColorSettingsLinearColorColour of the laser beam.
fnSetHoverState(out AlternateLocation: bool, out Location: Vector)Updates the laser's hover appearance and returns an alternate endpoint when the target overrides its hit location.
fnHandleSelect()Runs a selection against whatever the laser is currently pointing at.

Components/Interactions

BPC_Interaction_Select5 members
extends BPC_Interaction · implements OutsidePawnRPCInterface
KindNameSignatureDescription
varSelectSoundSoundSoundBaseSound played at the hit location when this object is selected.
fnCan be SelectedSelect(ref const HitComponent: PrimitiveComponent, SourceInfo: ST_SourceInfo, out CanBeSelected: bool)Returns whether this object may currently be selected by the given source, consulting Interface Select on the owner if implemented.
fnOverrideHitLocationSelect(out Override: bool, out HitLocation: Vector)Lets the owner supply a different hit location, so a laser can terminate on a chosen point rather than the raw trace hit.
fnHandleSelect(SourceInfo: ST_SourceInfo, HitResult: HitResult)Broadcasts On Select without playing feedback, for triggering a selection from code.
eventSelectPressed(SourceInfo: ST_SourceInfo, HitResult: HitResult)Fires when the object is selected, playing sound and haptics. Bind to On Select to react.

Components/PawnAbility

BPC_PawnAbility_Select3 members
extends BPC_PawnAbility
KindNameSignatureDescription
varInput_SelectInputInputMappingContextInput mapping context enabled while this ability is active, carrying the select action.
varSelectInteractionStyleStylePDA_InteractionStateInteraction state requested while hovering something selectable, controlling the cursor and accent colour.
eventSelect()Runs a selection against whatever the pawn is currently pointing at.
BPC_PawnAbility_Widget2 members
extends BPC_PawnAbility
KindNameSignatureDescription
varInput_WidgetInputInputMappingContextInput mapping context enabled while this ability is active, carrying the widget interaction actions.
varWidgetInteractionStyleStylePDA_InteractionStateInteraction state requested while hovering a widget.

Helpers

BP_Helper_ControllerAbility_Hand_Finger0 members
extends BP_Helper_ControllerAbility

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

BP_Helper_ControllerAbility_Hand_Laser1 members
extends BP_Helper_ControllerAbility
KindNameSignatureDescription
varControllerAbilityHandLaserBPC_ControllerAbility_Hand_LaserThe laser ability this helper draws for.

Interfaces

Interface_Select2 members
extends Interface
KindNameSignatureDescription
fnCanBeSelectedSelect(SelectComponent: BPC_Interaction_Select, SourceInfo: ST_SourceInfo, out Override: bool, out IsSelectable: bool)Implement on an actor to veto or allow selection under your own conditions. Return Override true and Is Selectable false to block; not implementing the interface means always selectable.
fnSelect_HitLocationOverrideSelect(out Override: bool, out NewHitLocation: Vector)Implement to redirect where a pointer appears to hit this object, for example snapping a laser to a control's centre.