Home › Systems › AFS_UX_Overlap
System

AFS_UX_Overlap

Overlap-driven interaction for direct touch: buttons and objects pressed with the hand rather than pointed at.

What it gives you

  • Direct-touch interaction for VR hands
  • Identifier filtering so only a fingertip triggers a button
  • A drag variant for physical sliders and levers

Requires

AFA_Sounds AFL_Libraries AFM_Abilities AFM_State AFS_UX_Grip

Required by

AF_Examples

4 assets18 API members

Description

Overlap interaction covers the case where the player touches something rather than pointing at it — the most physically convincing interaction in VR, and the one that needs the most filtering.

Without filtering, a whole hand passing near a button triggers it. BPC_Interaction_Overlap therefore has Allowed Identifiers: only abilities whose identifier appears in the list may trigger it. Setting it to the fingertip ability's identifier makes a button that must be pressed deliberately with a finger.

BPC_Interaction_Overlap_Drag extends this to drive a BPC_State_Drag, which is how physical sliders, dials and drawers are built.

Setup

  1. On the target, tag the collision component and add BPC_Interaction_Overlap, setting Component Tag Of Collision to that tag.
  2. Add BPC_ActorAbility_Overlap to the hand or fingertip that should be able to press.
  3. Bind to Overlap Started and Release.

Usage

Making a fingertip-only button

See Add a pressable button. Set Allowed Identifiers to the fingertip ability's identifier.

Physical sliders

Use BPC_Interaction_Overlap_Drag with a BPC_State_Drag and set Component Tag Of Drag Comp.

Allowing two hands at once

Set Allow Multiple Overlaps true.

A fingertip on a button, the button visibly depressed
AFS_UX_Overlap_result.pngA fingertip on a button, the button visibly depressed
A fingertip on a button, the button visibly depressed

Key properties

PropertyWhen to change
Allowed IdentifiersWhich abilities may trigger, by identifier; must be filled, an empty list accepts none
Allow Multiple OverlapsWhether several hands may overlap at once
Component Tag Of CollisionWhich collision component triggers the interaction
Sound Overlap / Sound End OverlapTouch feedback

Extending

Derive from BPC_Interaction_Overlap for new touch behaviours, or implement Interface_Overlap to veto conditionally.

Example map

Map_Examples_Overlap shows fingertip buttons and overlap drag.

Troubleshooting

The button triggers when the hand is near but not touching. The collision component is larger than the visual, or Allowed Identifiers lists the whole hand's ability as well as the fingertip's.

Nothing happens on touch. The hand has no BPC_ActorAbility_Overlap, Allowed Identifiers is empty or does not list that ability's identifier, or the collision channels do not overlap each other.

API reference

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

Components

BPC_ActorAbility_Overlap0 members
extends BPC_ActorAbility

Actor ability marking its owner as something overlap interactions react to. It adds no logic beyond the ability base; what matters is the identifier given to it, which overlap interactions match against their allowed list. Add it to a motion controller, a hand or any actor whose collision should be able to trigger an overlap.

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

BPC_Interaction_Overlap12 members
extends BPC_Interaction

Interaction that fires when a tagged collision component on the owner is overlapped by an actor carrying the overlap ability. Point Component Tag Of Collision at the primitive that should detect, and list the identifiers you accept; an ability whose identifier is not listed is ignored. The base only reports and plays its sounds, so bind to On Overlap Start or subclass it for a response of your own.

KindNameSignatureDescription
varComponent Tag Of CollisionSettingsnameTag identifying which collision component on the owner triggers this overlap interaction.
varAllowed IdentifiersSettingsname[]Ability identifiers permitted to overlap this object. Only abilities whose identifier is listed trigger it, so an empty list accepts none. Use it to restrict a button to being pressed by a fingertip rather than a whole hand.
varAllow Multiple OverlapsSettingsboolWhether several abilities may overlap this object at once, or only the first one to arrive.
varIdentifierSettingsnameName identifying this overlap interaction, reported through Source Info.
varSound OverlapSoundSoundBaseSound played when an ability begins overlapping.
varSound End OverlapSoundSoundBaseSound played when an overlap ends.
fncanBeOverlappedOverlap(OverlapAbility: BPC_ActorAbility_Overlap, out Enabled: bool)Returns whether the given overlap ability is currently allowed, consulting Interface Overlap on the owner if implemented.
fngetOverlapComponentOverlap(out OverlapComponent: PrimitiveComponent)Returns the collision component matching Component Tag Of Collision.
eventOnComponentBeginOverlap_Event_0(OverlappedComponent: PrimitiveComponent, OtherActor: Actor, OtherComp: PrimitiveComponent, OtherBodyIndex: int, bFromSweep: bool, SweepResult: HitResult)Internal handler that filters engine overlap events down to allowed abilities.
eventOnComponentEndOverlap_Event_0(OverlappedComponent: PrimitiveComponent, OtherActor: Actor, OtherComp: PrimitiveComponent, OtherBodyIndex: int)Internal handler that ends the interaction when the overlapping component leaves.
eventRelease(OverlapAbility: BPC_ActorAbility_Overlap)Fires when the overlapping ability leaves. Bind to this to run the release action.
eventOverlapStarted(OverlapAbility: BPC_ActorAbility_Overlap, OverlappingComponent: PrimitiveComponent)Fires when an allowed ability starts overlapping. Bind to this to run the press or touch action.
BPC_Interaction_Overlap_Drag5 members
extends BPC_Interaction_Overlap

Overlap interaction that starts a drag rather than a one-off event. When an overlapping ability arrives it spawns a drag latch at the contact point and hands it to a drag state component on the owner, destroying it again when the overlap ends. Add it to a lever, button or slider whose handle is meant to be pushed by a hand rather than gripped.

KindNameSignatureDescription
varComponent Tag Of Drag CompDragnameTag identifying the drag state component this overlap drives, so touching the object moves it along its configured axis.
fncanBeOverlappedOverlap(OverlapAbility: BPC_ActorAbility_Overlap, out Enabled: bool)Returns whether the drag may start, additionally requiring a valid drag component.
fngetDraggingComp(out DragComp: BPC_State_Drag)Returns the drag state component matching the configured tag.
eventOverlapStarted(OverlapAbility: BPC_ActorAbility_Overlap, OverlappingComponent: PrimitiveComponent)Begins dragging the object when an allowed ability touches it.
eventRelease(OverlapAbility: BPC_ActorAbility_Overlap)Ends the drag when the ability leaves.

Interfaces

Interface_Overlap1 members
extends Interface

Contract for an actor that wants a say in whether it may be overlapped, given the source info and the overlap interaction asking. Nothing in the shipped content calls it, so treat it as an extension point for overlap logic of your own; the shipped overlap interaction decides from its own list of allowed identifiers.

KindNameSignatureDescription
fnCanBeOverlappedOverlap(SourceInfo: ST_SourceInfo, CompOverlap: BPC_Interaction_Overlap, out IsOverlappable: bool)Implement on an actor to veto or allow overlap interaction under your own conditions.