Home › How do I…? › How to add a pressable button in VR
How to add a pressable button in VR
Advanced Framework Pro turns any mesh into a physical button with BPC_Interaction_Overlap, which fires when a fingertip enters a tagged collision. Add BPC_Interaction_Select next to it and the same button also works on desktop. By the end of this you will have a physical button the player can press with a fingertip in VR and click on desktop.
At a glance
Your actor
├─ Mesh
├─ Collision component tag "Press"
├─ BPC_Interaction_Overlap Component Tag Of Collision = Press,
│ Allowed Identifiers = fingertip identifier (empty = any)
└─ BPC_Interaction_Select the same button on desktop
Events: Overlap Started, Release
Steps
- Create an actor with a mesh and a collision component. Tag the collision component, for example
Press. - Add a
BPC_Interaction_Overlapcomponent and set Component Tag Of Collision to that tag. - Set Allowed Identifiers to the identifiers of the abilities that may press it, for example only the fingertip ability's. The list must not stay empty: an empty list accepts no ability.
- Bind to Overlap Started and Release.
- Add a
BPC_Interaction_Selectas well so the same button works on desktop.

howto_pressable_01.pngCollision component tagged for overlap

AFS_UX_Overlap_result.pngA fingertip on a button, the button visibly depressed
Notes
For a button that physically depresses, use BPC_Interaction_Overlap_Drag with a BPC_State_Drag
component instead, and set Component Tag Of Drag Comp to point at it.