Skip to content

Interact ​

Interaction state as read-only boolean nodes (hover, press, selected, focused) and the hit tests pointIn, sunk and covered. Available as Flux.Interact.

luau
local hovered = Flux.Interact.hover(button)

Types ​

HoverOptions type ​

luau
type HoverOptions = {
	-- Only guis outside the object cover it: a row, a card or a scrolling area stays hovered over its own buttons.
	within: boolean?,
}

Functions ​

pointIn ​

luau
Interact.pointIn(x: number, y: number, object: GuiObject): boolean

Whether the point (x, y) lies within object's absolute bounds (inclusive, ignoring rotation). Coordinates are inset-relative, matching InputObject.Position and AbsolutePosition.

Open Documentation

sunk ​

luau
Interact.sunk(x: number, y: number, object: GuiObject, token: any?): boolean

Returns true when input at (x, y) would be claimed by an Active or input-sinking GUI rendered above object (or while the Roblox escape menu is open). Pass the InputObject as token to share the hit-test query across multiple controls on the same input event.

Open Documentation

covered ​

luau
Interact.covered(x: number, y: number, object: GuiObject, token: any?): boolean

Returns true when input at (x, y) would be claimed by an Active or input-sinking GUI above object that is not a descendant of object.

Open Documentation

hover ​

luau
Interact.hover(object: GuiObject, options: HoverOptions?): Graph.Node<boolean>

Returns a read-only boolean node that is true while a pointer or touch contact is inside object with no input-claiming GUI above it. Pass { within = true } on containers so child controls inside object do not count as covering it.

Open Documentation

press ​

luau
Interact.press(object: GuiObject): Graph.Node<boolean>

Returns a read-only boolean node that is true while object is held down by pointer, touch, or gamepad/keyboard activation (ButtonA/Enter). Stays true until that input ends anywhere on screen.

Open Documentation

selected ​

luau
Interact.selected(object: GuiObject): Graph.Node<boolean>

Returns a read-only boolean node tracking whether object is currently GuiService.SelectedObject.

Open Documentation

focused ​

luau
Interact.focused(textBox: TextBox): Graph.Node<boolean>

Returns a read-only boolean node tracking whether textBox currently has keyboard focus.

Open Documentation