BetterClickDetector - No velocity lag click detector for vehicles

hello, i’ve been making vehicles on this game for a while now. (coming up on 4 years)

and i’ve always wanted to have a functioning cockpit with buttons, sadly, click detectors have had this long lasting problem where they would become unusuable when moving at speeds.

so, i decided when i ended up making my own system, to share it with everyone else in the same situation.

it’s a module, with some basic use which you can find out inside of the model.

to use a clickdetector, different from usual use, you have to make an intvalue.
here are the properties:
image
im sorry for not including the value inside of the script as i forgot when i uploaded it.

  • value is click distance
  • icon is a string attribute and its the mouse icon
  • player is a string attribute and its the player who activated the detector last.
  • active is used for telling when its activated, which you can use :GetAttributeChangedSignal()
  • active is updated using a remove event so its accessible through both server and client side scripts.
  • active is also push, so you have to let go of the mouse in order to deactivate, giving it a multi use, but you will have to do some checks when using :GetAttributeChangedSignal() because it will fire twice for the beginning and the end of the activation.

i used an attribute to control whether or not the detector is active mainly for modularity purposes, feel free to use this in whatever, i know keeping track of credits and assets you use can be a hassle so i really don’t mind.

thanks for reading

8 Likes