{"id":"kaiwaii4ever/hoversense","name":"hoversense","scope":"kaiwaii4ever","platform":"roblox","description":"A lightweight Roblox module for detecting mouse/touch/gamepad hover over tagged 3D instances","version":"1.0.3","latest":"1.0.3","versions":["1.0.1","1.0.2","1.0.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"sleitnick/observers":{"version":"^0.5.0","alias":"Observers"},"sleitnick/signal":{"version":"^2.0.3","alias":"Signal"}},"integrity":"9f2eeb46359e273a69e09f6e35f177944838bea188c5be37c4052f718997a005","likes":0,"downloads":0,"install":"forest install kaiwaii4ever/hoversense","url":"https://forest.dev/p/roblox/kaiwaii4ever/hoversense","files":"https://api.forest.dev/ai/package/roblox/kaiwaii4ever/hoversense/files","readme":"# HoverSense\r\n\r\nA lightweight Roblox module for detecting mouse/touch/gamepad hover over tagged 3D instances, with click detection built in.\r\n\r\nHoverable instances are marked using a [CollectionService](https://create.roblox.com/docs/reference/engine/classes/CollectionService) tag (`\"Hoverable\"` by default), no manual raycasting or per-object setup required.\r\n\r\n## Features\r\n\r\n- Detects hover via mouse, touch, and gamepad input\r\n- Configurable hover range and tag name\r\n- Fires distinct signals for hover start, hover end, continuous hover, and click\r\n- Client-only. Safe to require on the server (returns a no-op table)\r\n\r\n## Installation\r\n\r\nAdd to your `wally.toml`:\r\n\r\n```toml\r\n[dependencies]\r\nHoverSense = \"kaiwaii4ever/hoversense@1.0.1\"\r\n```\r\n\r\nThen run:\r\n\r\n```bash\r\nwally install\r\n```\r\n\r\n## Usage\r\n\r\n```lua\r\nlocal HoverSense = require(path.to.HoeverSense)\r\n\r\nlocal hover = HoverSense.new()\r\nhover:Start()\r\n\r\nhover.HoveringStarted:Connect(function(instance)\r\n\tprint(\"Started hovering:\", instance:GetFullName())\r\nend)\r\n\r\nhover.HoveringEnded:Connect(function(instance)\r\n\tprint(\"Stopped hovering:\", instance:GetFullName())\r\nend)\r\n\r\nhover.Clicked:Connect(function(instance)\r\n\tprint(\"Clicked while hovering:\", instance:GetFullName())\r\nend)\r\n```\r\n\r\nTag any part or model you want to be hoverable with the `\"Hoverable\"` CollectionService tag (or whatever tag you configure — see below).\r\n\r\n### Custom configuration\r\n\r\n```lua\r\nlocal hover = HoverSense.new({\r\n\tHoverRange = 15,\r\n\tContinuousHover = false,\r\n\tTag = \"MyCustomTag\",\r\n})\r\n```\r\n\r\n| Option            | Type    | Default       | Description                                                                           |\r\n| ----------------- | ------- | ------------- | ------------------------------------------------------------------------------------- |\r\n| `HoverRange`      | number  | `30`          | Max distance (studs) from the player's character to register a hover                  |\r\n| `ContinuousHover` | boolean | `true`        | If `true`, `Hover` fires every frame while hovering; if `false`, only on state change |\r\n| `Tag`             | string  | `\"Hoverable\"` | CollectionService tag used to mark hoverable instances                                |\r\n\r\n### Cleanup\r\n\r\n```lua\r\nhover:Destroy()\r\n```\r\n\r\nStops listening, disconnects all internal connections, and destroys all signals. Don't reuse the instance after calling this.\r\n\r\n## API\r\n\r\nFull API reference available in the [document](/api/Hover).\r\n\r\n- `HoverSense.new(options?)` — creates a new instance\r\n- `hover:Configure(options)` — update config after creation\r\n- `hover:Start()` — begin listening for hovers\r\n- `hover:Stop()` — stop listening and clear hover state\r\n- `hover:GetHovered()` — returns the currently hovered instance, if any\r\n- `hover:Destroy()` — stops and cleans up all connections/signals\r\n\r\n### Signals\r\n\r\n- `Hover` — fires while hovering (every frame if `ContinuousHover = true`)\r\n- `HoveringStarted` — fires once when a new instance starts being hovered\r\n- `HoveringEnded` — fires once when hover leaves an instance\r\n- `Clicked` — fires when the currently hovered instance is clicked\r\n\r\n## Dependencies\r\n\r\nIncluded via Wally dependencies already\r\n\r\n- [Signal](https://github.com/Sleitnick/RbxUtil/tree/main/modules/signal)\r\n- [Observers](https://github.com/Sleitnick/RbxObservers/tree/main/lib)\r\n\r\n## License\r\n\r\nMIT [LICENSE](https://github.com/kaiwaii4ever/HoverSense/blob/main/LICENSE)\r\n","readmeTruncated":false}