DragDetectors [Beta]

Thank you oh my godd i was waiting for this!!!

4 Likes

@foodeggs7 has been really helpful during this beta. They’ve reported and helped us find real bugs we needed to fix, and helped us understand the kind of problems people run into when they first use DragDetectors.

Please don’t go!

3 Likes

hello im a tad confused so if people dont have the beta feature turned on, will these work or not

1 Like

It’s confusing. I’ll try to break it down:

DragDetectors work everywhere, for everyone, when you publish them in your game.
You can consider it a full feature of your game that won’t go away.

The only thing that’s still in beta is creating them in studio. People who are not in the beta don’t see DragDetectors in studio and won’t be adding to the set of published games with DragDetectors.


Why are we doing this? To be careful as we make the feature more accessible. So we’re going to watch for a week, and see if any of you report problems in your games. If you find new usability issues, we’ll fix them before exiting the beta and calling it done.

3 Likes

I made a short video showing how to build a sliding door with DragDetectors.
No scripting, 3 minutes!
Probably basic for those of you following here, especially @YasuYoshida, but it also shows how to add the sliding constraint that is required.

8 Likes

Edit I would it for an tool but not working but how can I drag welded parts

how can i let welded parts drag an part before it not work becouse that block the drag detector so i tried it on this way but if you hold you can pick the balk out the puzzle the shape is like a H

2 Likes

It’s a little hard for me to understand what’s wrong. It seems like you’d like all those parts to slide physicallly and nicely, but they are getting stuck.

One thing I would check is that all the attachments for the constraints are nicely aligned and not maybe pushing one object a little to the side relative to the other one.

Also, if you want to post a piece of the game as an rblx file I can look at it and try to figure out if the problem is yours, or with DragDetectors.

If you are using welds to hold things in place when you’re not dragging, then you might need to [a] disable the weld during a dragStart callback, and then [b] enable it again on mouseUp.

1 Like

I can sent you tomorrow a file but I would use this for an tool but I think not it works in an tool and the puzzle is failed but I can try do it and then it above but then must it not go out

1 Like

Well, lets see if we can figure out what is wrong.
I’ll take a look when you send me your file.

2 Likes

I sent it here and dragdettectors not working in tools I need weapons for the game I started made with the game jam do you remember (I’m now busy with the story for it and will made a hal with fences what you must pick up but first pick things out ) but can dragdettectors work in tools I will made a X bow

Ok I have now made this fan it’s so player must walk through the air things by open the fan here but it must be unanchored to work but I can’t weld it how can I let’s it work by playing it Falls out

Look you must open it to go where the bacon stay but by running it falls it made with union and negative if you seen you must drag the Screws out the Schedule fan thing whatever it’s named

2 Likes

I love this feature but is there a way I can limit the distance between the object being dragged and the player? when I walk toward or away from the object it always stays in the same X and Z position. the result I want is the object staying at a certain distance at all times. (similarly to lumber tycoon 2’s dragging system)

6 Likes

Sorry to go off-topic, but that boid simulation is incredible!

1 Like

I stole it! I wanted some boids and wondered… did somebody already do this in roblox so I don’t need to code it again?
And the answer was yes, there was an awesome, nicely configurable plugin (I think) that inserts the boids system but I can’t find it anymore and I forgot where I found it.
The top-level script says:
@ee0w wrote it and they thank Sebastian Lague for inspiration.
@ee0w if you see this, thanks very much, and if you have a good way for others to use your code, let us know.

But Projectile Madness is open for you to download and play with. Look for “BoidGroup” which contains my slightly edited version of the original.

Also the other stuff in Projectile Madness is pretty cool. It was a gamejam project done with friends here at Roblox HQ. The awesome catapult with spring control was done by @itsfrank17

Projectile Madness

7 Likes

I think you should be able to do something like that by setting your referenceInstance as the humanoid dragging it, and setting a translation limitation.

For example, if you set the referenceInstance to the dragging player’s humanoid on dragStart with its Min/Max DragTranslation as something like (5, 0, 0), it will stick to 5 x-studs ahead of the humanoid and stay there as you drag, relative to it.

Of course, you should tinker with it to find the right translation limitations, but this should work.

NOTE: This did not happen previously, and is a bugfix that should be going into effect later this week.

6 Likes

this is what I tried! thought I was doing something wrong, thank you for telling me lol.

3 Likes

I sent you a reply with some help for the sliding block puzzle in your world. You’ve brought up several issues and I’ll need to look at them one at a time. I’'ll address another one tomorrow.

For those reading, @foodeggs7 has a sliding block puzzle that was working oddly.
To get nice motion in a line in the physical world, you need to [a] make sure your Axis points in the right direction in the space of the referenceInstance, [b] use TranslateLine, and [c] add a Prismatic constraint if you want no extraneous motion other than the line (because momentum and other factors can make the object rotate out of alignment).

The video I posted the other day shows the general method (although leaves out the parts about referenceFrame and assumes everything is in worldspace relative to the baseplate)

4 Likes

Cool idea for an approach!
Note that if you set the minDragTranslation and maxDragTranslation equal, then the DragDetector won’t constrain it, they need to be different. But not by much.

4 Likes

While @DeFactoCepti 's proposed solution with the minDragTranslation/maxDragTranslation should work, it’s not the only way.

Earlier this summer there was a discussion on “keeping something in front of you” and we did it using a custom DragStyle that has a DragStyle function that keeps it in front of the player.

It’s a little more complicated than @DeFactoCepti 's solution, but it also keeps the object oriented in front of you, and since it’s a method you can add variation to make it as fancy as you like.

@foodeggs7 I’m not sure whether this will help you get “tool like” behavior you need or not, but I’ve attached the place file here.

Note that it uses the dragger with runLocally so it can know about the player but also uses a remoteEvent to send the cframe to the server so that other players will see the change.
StayInFront_Unanchored.rbxl (52.8 KB)

3 Likes

Edit: found the problem. Turns out the lemons were in a different position from the server vs the client for some reason. On the server they were on the ground.

I need a bit of help

The dragger is kinda wonky when the part is connected to something via a RigidConstraint that is destroyed when the DragStart event fires.

robloxapp-20231002-2209378.wmv (3.9 MB)

It works perfectly fine when the lemons are picked up from the ground, though.

This is the code for my drag style function

local function ItemDragDetectorFunction(ray)
	local origin = ray.Origin
	local direction = ray.Direction

	local raycastResult = Workspace:Raycast(origin, direction * 1000, dragRaycastParams)

	if direction.Magnitude > MAX_DRAG_DISTANCE then
		direction = direction.Unit * MAX_DRAG_DISTANCE
	end

	return CFrame.new(origin + direction)
end

I can send a place file if needed

4 Likes

When will this be going live for published games?

3 Likes