DragDetectors [Beta]

Where is the drag detector logo for mobile

3 Likes

I don’t really understand the question. Can you describe the sequence events you want to have happen? Clicking, moving WASD keys, etc?

Generally speaking, if you click a part with a DragDetector and navigate the character while holding the mouse down, the object will move with the player.

2 Likes

I agree with you. This block should not move. I will file a bug and look into it. If I come up with a workaround, I will post it here.

2 Likes

Do you mean the circular touch indicator? We had to disable it temporarily because it was also showing up in games when users touched a SurfaceGUI.
We have a fix to make it work only when we desire; but until then we need to disable it because the issue effects existing games.

If you mean something else, let me know?

1 Like

Way nut add the same as the pc what in the past was by click detectors then as you used click detector then you saw a cursor

2 Likes

That cursor is not used on mobile as the cursor is a pointer optimized icon, so the normal touch optimized icon is a transparent circle.

1 Like

DragDetectors appear to not be enabled for my place.

UserId: 47979956
PlaceId: 462997381

2 Likes

Hello Firefly!
I have figured out the problem with your constraint script.
You are setting ReferenceInstance = nil, which is a bad idea in general if applying a constraint. The DragTranslation and the motion you return from your constraint function are both expressed relative to the ReferenceInstance. If it’s nil, it is implicitly the object pivot, and will move with each drag. So best to set ReferenceInstance to BasePlate or Terrain or an anchored Marker: something stable.
If you do that and then remove the “ReferenceInstance = nil” from your script (or change it to set the DragDetector.ReferenceInstance = game.Workspace.Baseplate

Then i think it will work fine. It may jump the first time, to bring the object between your MinDragTranslation and MaxDragTranslation. But the jump shoujld only happen once.

1 Like

Thanks,This does work, I solved the problem by setting the ReferenceInstance.
My requirement is to prevent the specified player from dragging by Constraint, but I have another problem, “AddConstraintFunction” doesn’t have player as Parameters, is there any easy way to allow only one designated player to drag?

2 Likes

Great idea!
People have been asking for an “allowedList” and we may add one after the first release.
But your idea just needed a little bump to work.
Here is a world with the script:
AllowedListViaConstraintFunction.rbxl (46.5 KB)
And here is a video explaining it:

4 Likes

yes. Sorry about that. I was unable to verify that your user is connected to the game. It is owned by a group, and I don’t see you in any publicly facing admin lists etc.
UPD: My bad. I see posts from you. Should be enabled now.

3 Likes

Thank you, I solved the problem by adding allowedPlayersList. Looking forward to DragDetector going live soon. I’ve got the game ready. :smiley:

1 Like

@PrinceTybalt @Urukeli

I have two questions

  1. Can drag detectors maybe added for GUIs so you have not script it (it’s useful.so I can add it to my plugin)

  2. Go drag detectors enabled for all experience in december if not is it possible to fill.in the firm 2 times for 2 other experiences (I have a great idea with it for my new year obby and will made levels with it in my Christmas obby (I will make this after the next event for my obby so I can Preparing in time ))

2 Likes

You can request to have DragDetectors enabled in your game now, if you like. See the above post, I think from @Urukeli

When it goes live, post a link here? I’d like to see. :slight_smile:

1 Like

Hey, @here. As announced previously we made a slight, but breaking API change to the function DragDetector:AddConstraintFunction. We also deleted RemoveConstraint function.
New syntax instead taking name argument returns RBXScriptConnection. So to remove the constraint function one would have call :Disconnect() on returned object.

There are changes required to be made to keep code working:

Old code examples:

dragDetector:AddConstraintFunction("MyConstraint", 10, callback)
-- ...
dragDetector:RemoveConstraintFunction("MyConstraint")

New code

local myConstraint = dragDetector:AddConstraintFunction(10, callback)
-- ...
myConstraint:Disconnect()

Test Worlds should be up to date with this changes

3 Likes

This should be the last API change for DragDetectors.
Also note that the two test worlds have been updated to use the new API:
DragDetectors TestWorld 1

DragDetectors TestWorld 2

5 Likes

I got an error by:

local myConstraint = dragDetector:AddConstraintFunction(10, callback)

Error: Argument 3 missing or nil

1 Like

Make sure to update Studio when update is available. It is rolling out, pace may vary.

1 Like

I am running that code correctly at UTC+0 20230713 10am
An update occurred again on UTC+0 20230714 2am, and an error occurred at this time.
I tried multiple different computers and reinstalled Studio, but still reported an error.

Did the API restore the state of the old version due to last updates?

1 Like

@PrinceTybalt @Urukeli

I have two questions

  1. Can drag detectors maybe added for GUIs so you have not script it (it’s useful.so I can add it to my plugin)

  2. Go drag detectors enabled for all experience in december if not is it possible to fill.in the firm 2 times for 2 other experiences (I have a great idea with it for my new year obby and will made levels with it in my Christmas obby (I will make this after the next event for my obby so I can Preparing in time ))

  3. Is it maybe posible that I have enabled it in 2 experience now I think I will use it for connect 2023

2 Likes