DragDetectors [Beta]

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

Studio made all possible updates. The suggestion of the Name argument is still visible, and it still requires 3 arguments (as mentioned) as of now.

1 Like

There is a bug i have noticed with the dragdetector which makes the dragdetector still think you’re holding it after you’ve picked up a tool

how to replicate:

  1. Get a tool with a touch interest in it
  2. Hold a drag detector instance
  3. Pick up the tool
  4. It’s broken
3 Likes

Awesome Feature, i might use this in the future great work!

3 Likes

I think just be a little patient. We’ve had some version rollbacks and some strangeness on iOs touch devices but when the versions all settle it should be stable and all using the new API.

Sorry if it’s not a smooth transition.

1 Like

“Can drag detectors maybe added for GUIs so you have not script it (it’s useful.so I can add it to my plugin)”?
I’m not sure what you mean here. Are you talking about 2D screen guis? We’ve gotten several requests for this, as well as DragDetectors within Viewports. We may do that after our first release of DragDetectors.

“drag detectors enabled for all experience in december?”

Actually… we hope to enable DragDetectors in all games way sooner: in the next couple of weeks.
We will stay in the beta for authoring, but if you put DragDetectors in your games, they will work without filling out any forms.

Stay tuned, we will announce when they go live in all games.

1 Like

Ooh thanks. There are a lot of cases where a drag is interrupted and we may not have caught them all. We will look into this one.

1 Like

Ok but can I have 2 experiences with it enabled but I have joined my test place but there it is disabled can it enabled in a new experience between 28 July and 7 August through fill in the form again

Ye I meen screen guis

1 Like

can we have a RBXConnection when two guis overlap just like touch events?

1 Like

Hi @foodeggs7

I see your first game in the form. I’ll make sure it’s turned on.
Can you fill out the form for your second game so we can enable that as well?
You can have DragDetectors enabled on as many games as you want.

1 Like

The place be created 28 July (it is for the connect 2023 challenge)

1 Like

If you want you can create the game now with no content and fill out the form. We can enable it now for later. Then it will work later when you are ready to build the game.
(although there’s a chance DragDetectors will be enabled in all games by July 28 without needing to fill out theform)

1 Like

I’m not sure of that may maybe the disqualified me if I create it early then the start date but I seem then of it’s enabled for all gsmes or not if not I fill in the form then

1 Like

Okay. I will mark my calendar and check back here on the 28th to make sure we get everything working for you.

1 Like

also: we checked, and DragDetectors should be enabled in your first game. Is it working for you?

1 Like