Announcing DragDetectors!

The mechanism reminds me of a soft body, I’m now curious whether you could fill in the gaps using a deformable mesh to make a soft body ish in roblox

1 Like

I added a text version of the plugin’s script. If you’d like to take it and modify it for experiments, feel free.

2 Likes

Omg thank you so much this took me ages to fix

2 Likes

@hya123456h do you mind if I include this world in an upcoming DevForum “Expert’s Corner” article? I want to do one where i show solutions to some rotation problems that game authors have had. I’ll credit you in the article.

2 Likes

Perfectly ok with that. Your a very good expert

2 Likes

This feature is pretty cool and useful. You can use this feature in any game genres. Also, if you want to make a tycoon or a simulator game then drag detector is there for you. I love this feature :smiley:

1 Like

Um bit late but just got a chance to test it as on holiday and I can’t see any different in scripts. Are you sure it is the correct file as none of the changes you mentioned are in the file?

1 Like

Oh my, I thought I’d saved the revised version but it looks like I didn’t save the edits/changes.
I’ll regenerate these and post again…

2 Likes

Here you go, this has the changes I mentioned above…
KingBob_DragDetector_Fixed.rbxl (78.7 KB)

1 Like

Thank you so much for this. Although I am getting this weird bug whenever I drag it to then end and then switch handles I think to do with the angular velocity. Could you think of any quick fix or reason as to why this could be happening?

It probably has to do with the fact that your cursor has moved off of the line of motion; and then when you switch directions the next time you move your cursor it tries to move the object to the projecti0n of the cursor onto the new line of motion.

Am I correct in saying that this does not happen if you move such that your cursor is always on top of the part?

The attached version may help. I’ve added the following at the beginning of your ChangeAxis() method. It switches from TranslateLine to TranslatePlane and calls RestartDrag(); this kind of re-roots your cursor onto the current perpendicular plane to the line of motion; and then when you change the direction and go back to translateLine, you’re projecting onto the line the emanates from your cursor, as opposed to the a line that goes through the part.
Following this, you may find the motion a little faster or slower than before, but you should lose the jump:
KingBob_DragDetector_Fixed.rbxl (79.1 KB)

	-- this little trick will reroot the cursor relative to the plane and then back to the line.
	-- it gets rid of the little skipping/sliding that can happen if you only change the axis while staying in TranslateLine mode.
	script.Parent.DragDetector.DragStyle = Enum.DragDetectorDragStyle.TranslatePlane
	script.Parent.DragDetector:RestartDrag()
	script.Parent.DragDetector.DragStyle = Enum.DragDetectorDragStyle.TranslateLine
1 Like

For some reason it now descends when moving and rotates itself. (Realized it would do the same in the first fix)? The angular velocity doesn’t stop it at all

Sorry for all the bugs. I really appreciate you helping

Does anyone know why this strange drag detector behavior happens? It doesn’t allow me to drag the object in the opposite direction once it meets its max angle, instead, it clips into the wall.

Also when I set the ReferenceInstantce property to it’s parent, the drag detector’s angle appears to be 90 yet it only travelled half the distance as the previous video

More info here

2 Likes