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

3 Likes

Hi @Rynappel,

@DeFactoCepti is going to look into this problem soon, but can’t do it right away.

In the meantime, can you try setting it up so that the axis of rotation is the Y axis of the ReferenceInstance and not the X axis?

X-axis rotation has been trickier to get right with min/max for us, because of the way rotations are stored, which is as euler rotations that sequence Y/X/Z.

We found when when devloping this code that Y-axis and Z-axis rotations were easier to get right.

If you try this, please let us know how it goes?

2 Likes

Same behavior on the Y axis

Hi @PrinceTybalt

What are the enums from ResponseStyle and PermissionPolice I need for my plugin auto properties

For this script

Okay. @DeFactoCepti will look into it. Can you upload a simple rbxl file for the place that exhibits the problem? Just the switch and the script effecting motion, if there is one?

1 Like

DragDetectorWeirdBehaviour.rbxl (60.6 KB)

I’m not sure what you are trying to do, but I would just leave them as their default values. Why change them?

The default ResponseStyle “Physical” will move non-anchored objects with physics, and simply edit CFrames of anchored ones.

the default PermissionPolicy is “Everyone” which will allow all users to drag it.

Ye but in my plugin you can select the other styles and it you insert dragdettectors it have this preset if you want that valeus