Instances

fireclickdetector

Fires a ClickDetector with optional distance and click option values.

Syntax

fireclickdetector(detector: Instance, distance?: number, clickOption?: "mouseclick" | "rightmouseclick" | "mousehoverenter" | "mousehoverleave")

Arguments

NameTypeDescription
detectorInstanceClickDetector instance to fire.
distance?numberOptional interaction distance used for the click simulation.
clickOption?"mouseclick" | "rightmouseclick" | "mousehoverenter" | "mousehoverleave"Interaction to simulate. Defaults to mouseclick.

Description

Fires a ClickDetector with optional distance and click option values.

Call it with 3 parameter(s): detector, distance, clickOption. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Simulate the default left-click interaction on a ClickDetector.

local detector = workspace.InteractivePart.ClickDetector

fireclickdetector(detector)