语法
fireclickdetector(detector: Instance, distance?: number, clickOption?: "mouseclick" | "rightmouseclick" | "mousehoverenter" | "mousehoverleave")参数
| 名称 | 类型 | 描述 |
|---|---|---|
detector | Instance | 单击要触发的Detector 实例。 |
distance? | number | 用于点击模拟的可选交互距离。 |
clickOption? | "mouseclick" | "rightmouseclick" | "mousehoverenter" | "mousehoverleave" | 交互模拟。默认为鼠标单击。 |
说明
触发具有可选距离和单击选项值的 ClickDetector。
使用 3 个参数调用: detector, distance, clickOption。参数表会说明哪些值必填,哪些值只用于细化行为。
不返回数据。将调用视为一个动作,并在调用点附近处理错误。
示例
模拟 ClickDetector 上的默认左键单击交互。
local detector = workspace.InteractivePart.ClickDetector
fireclickdetector(detector)