Syntax
fireclickdetector(detector: Instance, distance?: number, clickOption?: "mouseclick" | "rightmouseclick" | "mousehoverenter" | "mousehoverleave")Arguments
| Name | Type | Description |
|---|---|---|
detector | Instance | ClickDetector instance to fire. |
distance? | number | Optional 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)