Announcing DragDetectors!

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

Are the ui dragdettectors already out I noticed it in reclass plugin but it doesn’t work how does it work @PrinceTybalt

https://devforum.roblox.com/t/script/2945177/4?u=foodeggs7

Way you can change them in the properties window then???

It’s like in my plugin you can change that properties and when you insert them it insert it with that properties

I’m surprised drag detectors still have the same problem as click detectors: they simply don’t work on fast moving parts. I’ll drop a link below if a staff ever notices this message and decide to resolve this problem.

@PrinceTybalt there still is an issue with the dragdettectors on mobile if I want to drag my puzzle it doesn’t directly drag and it are time based puzzles so it almost impossible to complete it in 1 min but I think I want it 30 sec buy the camera go before the dragdetectors able if I drag on the left

1 Like

When the Drag Detector is added during the game and the responseStyle being physical, it does not work. It seems to only work if it is present from the beginning of the game.

I assume this is a bug, if not how am I able to fix this

After three months, still no answer to my post @PrinceTybalt

Was there ever an update on this? I am currently trying to use DragDetectors to move my own character, but it doesn’t seem to be working.