# ClickDetector

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Subclasses: [DragDetector](https://rapi.sleaze.dev/classes/DragDetector.md)
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/ClickDetector/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/ClickDetector

An object that provides user input on in-experience `BaseParts` and `Models`.

## Properties

### MaxActivationDistance

```luau
ClickDetector.MaxActivationDistance: number = 32
```

- Tags: Read capabilities: Input

Maximum distance between a character and the [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md) for the player to be able to interact with it.

### CursorIcon

```luau
ClickDetector.CursorIcon: string = ""
```

- Tags: Read capabilities: Input

Sets the cursor icon to display when the mouse is hovered over the parent of this [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md).

### CursorIconContent

```luau
ClickDetector.CursorIconContent: Content
```

- Tags: Read capabilities: Input

Sets the cursor icon to display when the mouse is hovered over the parent of this [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md). Only supports asset URIs.

## Events

### MouseActionReplicated

```luau
ClickDetector.MouseActionReplicated: RBXScriptSignal<(player: Player, actionType: number)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Input

### MouseClick

```luau
ClickDetector.MouseClick: RBXScriptSignal<(playerWhoClicked: Player)>
```

- Tags: Capabilities: Input

Fires when a player interacts with the parent of a [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md).

### MouseHoverEnter

```luau
ClickDetector.MouseHoverEnter: RBXScriptSignal<(playerWhoHovered: Player)>
```

- Tags: Capabilities: Input

Fires when the parent of a [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md) is hovered over by a player.

### MouseHoverLeave

```luau
ClickDetector.MouseHoverLeave: RBXScriptSignal<(playerWhoHovered: Player)>
```

- Tags: Capabilities: Input

Fires when a player's cursor hovers off the parent of a [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md).

### RightMouseClick

```luau
ClickDetector.RightMouseClick: RBXScriptSignal<(playerWhoClicked: Player)>
```

- Tags: Capabilities: Input

Fires when a player right clicks their mouse cursor on a [`ClickDetector`](https://rapi.sleaze.dev/classes/ClickDetector.md) or [`DragDetector`](https://rapi.sleaze.dev/classes/DragDetector.md).

### mouseClick

```luau
ClickDetector.mouseClick: RBXScriptSignal<(playerWhoClicked: Player)>
```

- Tags: Deprecated, Capabilities: Input
- Use instead: [`ClickDetector.MouseClick`](https://rapi.sleaze.dev/classes/ClickDetector.md)

**Deprecated:** This deprecated event is a variant of [`ClickDetector.MouseClick`](https://rapi.sleaze.dev/classes/ClickDetector.md), which should be used instead.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
