ClickPoint - Re-implementation of ClickDetectors that support movement

ClickPoint

A simple re-implementation of ClickDetectors.


Github Repository | Documentation

What is ClickPoint?


ClickPoint is a simple module that re-implements ClickDetectors.

It will allow you to create “ClickPoints” that work with moving parts. This was a huge issue that I was running into while trying to build buses, trains, and other vehicles with first-person clickable objects.

I accomplished this by creating ClickDetectors that update on the render step on the client. During testing, I found this worked perfectly for my requirements.

There seemed to be a lack of a widely-available module that accomplishes this so I have decided to release this to the public.

ClickPoint Features


  • Can be dropped into existing ClickDetector code without much issue.
  • Supports button down/up events for both buttons on the mouse (left and right click).
  • Simple tooltip implementation available and functional out of the box.
  • Hover cursor can be changed during script execution.
  • Supports maximum activation distance (checks are performed on server-side to ensure that players outwith the activation range cannot trigger events on a ClickPoint.

Screenshots/Demonstrations


Tooltip Example

Example of a Tooltip

ClickPoint Demonstration (large GIF!)

Demonstration of ClickPoint in action

Example Code


Example code can be found in the README of the GitHub repository for this project.

Feedback? Questions? Suggestions?


Feel free to leave your feedback, questions, or suggestions below - or raise an Issue on the GitHub repository! A lot of the optimizations and features may not have happened if it wasn't for the input of others'.

Also, if you've made any changes to the code you'd like to see everyone else use, please create a pull request with your changes.
22 Likes

Thank you for creating this, keep doing what you’re doing!

3 Likes

This is an extremely useful resource. However, it doesn’t really appear to be working for me? What am I doing wrong?
grafik

I’m not sure what the issue is as I can’t see what you’ve put in the Script, however you don’t need to have a ClickDetector instance inside the part (ClickPoint sets itself up with Attributes).

Feel free to make an issue on GitHub and I may be able to assist you further there.

NOTICE


A bug has been fixed in the tooltip generation code (if you move across extremely close objects too fast, the Tooltip will not update)

Please update to ClickPoint v1.2.3 as soon as possible.

Thank you.

Pretty much the example script

Okay, I don’t know what I did wrong yesterday, but now it’s working just fine

1 Like

Wow, just Great Job and thank you very very much for this,
It helped me extremely with my Train Game.
Please don’t stop improving this if needed and I will also recommend this to many more people because this deserves way more attention.

Also, I have a Question,
Is it possible to let the Text slowly appear when you hover over the Part and when it leaves it slowly fades away?

I would do it with Tweenservice but I don’t know where the line is that makes the text appear/disappear when the Mouse leaves the part.

This line generates the Tooltip: ClickPoint/ClickPoint_Client.client.lua at c28ba6159698d2dc795ecafeb014d0cf479a1f90 · fnuerpod/ClickPoint · GitHub

Any line that says the following is how the Tooltip is removed:

TOOLTIP_STORAGE:Destroy()
			TOOLTIP_STORAGE = nil

Hope this helps!

Okay, so now it works when you hover over it the transparency of the Text gets slowly smaller, but now It to go higher when the Mouse left the Part.
I tried to make it with the Destroying Line but it didn’t work with the Tween.

Any other Ideas how I could do it?

Greetings,

The best thing you could do is fork my repository on GitHub and make your changes in your fork - this way I will be able to debug the code and see how you are doing it (perhaps once finished it can be merged into the main project).