Introducing UIDragDetectors [Studio-only Beta]

This makes sliders so much easier to make! Can’t wait to experiment with this. Although there are some issues I noticed with the mobile interface, certain cases it’s impossible to select the GUI.

3 Likes

This absolutely does not work with objects put inside other GUI objects with UIListLayout, UIPageLayouts, and UIGridLayouts. I believe it would be a benefit to also enable this feature for those objects. As of now, people would have to use a hacky fix of parenting cells inside and outside of the said container to move the object.

1 Like

Sooo, you are saying I don’t have to do hacky workarounds and custom drag classes anymore? wohooooo ty :dancer:

Depends on how you’re using it. For me, it’s more complicated because I’m dealing with other constraints.

The last issue you mention is interesting-- I’ll keep an eye out for that.

For the indicator appearing in the wrong area / being stuck, and needing to re-join the game, those are known issues and we are hoping to have a fix out by next Thursday.

More specifically, the indicator not going away / needing to re-join the game happens with UIDragDetectors on SurfaceGuis when you drag it outside the SurfaceGui area. It doesn’t terminate properly, and causes these issues. It is actively being worked on and should be resolved in the near future!

1 Like

You would need to implement some custom input detection that triggers a change in the UIDragDetector’s DragUDim2 property to do the first behavior yourself, if I understood correctly. It doesn’t seem too trivial of a thing either, especially if the UIDragDetector is in a different DragSpace.

To drag a UIDragDetector with script only though, should be possible by simply setting the DragUDim2 property to a value you desire-- either a translation if there is no ReferenceUIInstance set, or a relative position to the ReferenceUIInstance if you do have it set.

  • Ex: If you wanted to move something from (0, 0) to (100, 100) in 50 frames, you could set the DragUDim2 to UDim2.fromOffset(2, 2) every frame for 50 frames. You’ll need to set it to UDim2.new() before/after setting it to (2, 2) as not changing the property doesn’t trigger the dragging behavior, but this would essentially move it by (2, 2) every single time you set it. This would be how you’d do it without a ReferenceUIInstance.

If that’s not what you were trying to do, please clarify and I can reply again!

1 Like

Is the case where you can’t select the GUI happening on SurfaceGuis, or ScreenGuis?

1 Like

We are working to have a solution for Layouts before full release!

3 Likes

What constraints would make dragging with UIDragDetectors more complicated? We’d like to know where we can improve this feature on. (Your previous reply was for Layouts-- we currently do lack support for them but it’s definitely on the to-do list)

3 Likes

What’s the current timeline for full client release? I’ve got an update that I need to get out within the next week or two that could use this if the release timeline is quick enough.

2 Likes

Seems like an amazing feature that will help my game’s development so much :slight_smile:
Thanks dev team!

2 Likes

how would I be able to set slider positions from a script ? I’m using this for colour customisation and I’d like it to properly reflect pre-selected colours on join.
a small issue, which I’m sure is caused by me incorrectly setting them up, is that the sliders don’t hit the very end of the bars, causing the values to never hit 0 or 1, only somewhere in between.

other than that, they work great ! suuuper easy to use, once I get over these hurdles I’ll go ahead and start using these in different areas as well ! thank you for this !

3 Likes

how does the ui scalling and slide bar work?

2 Likes

We are hoping to enable this on clients by late August, or at the latest, early September!

4 Likes

I’ll leave this here if you need just dragging and a few customization options.

2 Likes

Around 3 weeks or less, sweet!

2 Likes

First of all, thanks for replying. I have never really met such an active admin/staff member. The idea I had that would overcomplicate the drag detector is being able to also have TWEENING animation support; the same that is seen with UIPageLayouts (built-in tweens). Another example of complicated constraints would be dragging an object that was not being dragged at all in the first place (take Minecraft’s UIs for inventory/hot bar, you can split the number of items you want so the actual cell of objects still remains but a new cell is created and dragged upon activation of ANOTHER object). This system is common in many MMORPG and even IO browser games on the internet nowadays. I’ve experimented this myself, but I couldn’t polish it.

Sorry for the long message by the way! :slight_smile:

2 Likes

Might have read the question wrong but it is very likely the drag detector actually puts GUIs at the absolute position of the mouse which is size in pixels (offsets) and not scale. There are limits put on the slider so you can only drag it within the boundaries of another UI.

2 Likes

Not sure if I can reproduce this at all-- do you have a .rbxm you can share or a video of this happening?

2 Likes

Here’s an example of it happening. try holding the handle as it gets destroyed.
dragCloneBug.rbxm (11.1 KB)

2 Likes