I have this lever where you have to drag it side to side, it uses the dragdetector with max and min angle limit of 65 and -65 degrees. However the limit seems to reset after the mouse is finished with being dragged.
I tried clamping and stuff like that but it just doesn’t give the same feeling like it should
1 Like
Can you specify the DragDetector’s properties a bit more? I have a setup that works but I don’t really know how it is different from yours.
Edit:
Okay I tested it a bit more. It seems that when you set the ReferenceInstance property to the think you are dragging, it resets the limit relative to the new rotation when you drag again.
Try removing the ReferenceInstance property to nothing, let me know if it works.
it doesn’t turn around the pivot attachment (the reference instance was an attachment). But i think i can get it to pivot around it with some scripting. Thx!
You can make the lever a model and change it’s pivot offset.
I think you needed to set the PrimaryPart.
Sorry if I remember incorrectly. 
Hey so a few things. Make sure you have the ReferenceInstance
set to the base of the lever. This is pretty much just the pivot of rotation when you have the DragStyle
set to RotateAxis
.
Make sure the ResponseStyle
is set to the default value of Physical
. This makes it so that it respects the Roblox physics engine, and all constraints of the part it transforms.
With all of this in mind, you can just use a Hinge Constraint to properly limit the drag angle. Take a look at this: Lever Example - Creator Store