DragDetectors [Beta]

I haven’t tried it but you’d have to do something pretty crafty. It’s not really their intended use and player motion is controlled by all kinds of scripts. Maybe you could disable the scripts or put the player in a custom mode and then put a dragdetector under the humanoid root?

On the other hand, if you stand on an object with a dragDetector you can pull that object and go for a ride.

Let’s go surfing!!!
Might even be better with a proper seat object…
Surfin

2 Likes

Yeah I was just wondering why you would mention both models in each one, sorry about the confusion

2 Likes

Not very important to use shift. other keys would work. :slight_smile:
I shall have a go at upping the plane offset to 15. thank you.

1 Like

How can I set the maxactivation distance from the dragdettector that it only 32 is for the team the player is in

So a player in your team place the model with the dragdettector it set for that team it on 32 and the other teams 0

I will use it for my game I has made for a game jam but now we will complete that Game

I will made a party system using teams with space for 4 partys do if all parties are used server be Descending and only friends can join and come in the party from the inviter then you can attack others but so I made a block with a dragdettector what only can be used for that team and you be atacked by creatures

1 Like

If you are trying to make a DragDetector that only certain players can use, there is anoher way to do this than giving them different activation distances. You can add a constraint function that only moves when certain players click it.

Here is a link to a video that shows you how to do this, and the script required is in the description.
You can modify the script to compare the ‘draggingPlayer’ to any of the allowed players in your group.

(Note that we also hope to add an easier way to do this in the coming months with new API:
a property named PermissionPolicy with 3 values: Nobody, Everybody, or Scripted. If scripted, you may register a method dragDetector:SetScriptedPermissionCheck(function(player, part) that returns true if the player may drag the part, false otherwise.)

1 Like

DragDetectors are officially released, and out of beta!

Thank you all so much for your feedback and questions during our beta period. You’ve made a huge difference.

We will continue to watch this post for questions. But please join us over at the new announcement post, and bring your experience there to help the new creators as they join us in building new kinds of interactive games in Roblox!

https://devforum.roblox.com/t/announcing-dragdetectors/2641956

3 Likes

Good idea! Imma make a game of that!

2 Likes

@xxoof_oofoofxxALT please share a link when you have something!

We are all eager to see what you do with this in real game settings!

3 Likes

That’s not really I’m searching for I mean if a player in a team place a model with dragdettectors only that team can use that

And in my story the dragdettector cannot drag screws out the wall

The fan clitch out the wall because the union collision thing is not set to box but I still cannot drag the screws

1 Like

Quick question, Mouse.Button1Down doesn’t fire when clicking on a part with a DragDetector parented under it. Is this intended behaviour? If so, what alternatives can I use?

2 Likes

@MintSoapBar I’ve never used that API. I suspect that the DragDetector may be swallowing the event before your mouse gets a chance to process it.

As an alternative, you can put your code in a response to dragStart:

dragDetector.DragStart:Connect(function(...)
     -- do what you wanted to do on Mouse.Button1Down here.
end)

You can actually make some cool variations on buttons using DragDetectors that you were never able to do with clickDetectors, because you can detect both the down and the up on dragStart and dragEnd.
If you set the ResponseStyle to custom, and then don’t do anything, then the part won’t move but you can still detect down and up.

There are 3 button examples in DragDetectors TestWorld 2
A push button, a sprarying button , and a toggle button:
ThreeButtons

3 Likes

Is there a simple alterative that you know of? Right now, the only alternate option I know to detect mouse clicks is ContextActionService (as UserInputService just returns an input object with a KeyCode.Unknown), but that overwrites the DragDetector. I want to be completely sure that there is no other alternative to just connecting my function to listen to every single DragDetector’s DragStart event in my game since that doesn’t seem to be too performance friendly when there can be hundreds of DragDetectors present at the same time.

2 Likes

@razorter by the way @DeFactoCepti has check in a fix for this enabled issue. It should go live in about 2 weeks. ‘enabled’ will be checked when the drag is attempted, not just when the client sends the signal; so your timing issue should go away.

2 Likes

If ContextActionService is getting you the information you need, then I think you are in luck. :slight_smile:

If you are using BindAction, then your action handler can return the value
Enum.ContextActionResult.Pass.
This will make it so that your handler doesn’t “claim” the event for its own use, and the events should continue on to the DragDetector.
By default, if you don’t return a value, then it assumes you want ContextActionResult.Sink which prevents others from using it after you

2 Likes

I’m trying this out, the part won’t even accept that I’m clicking on it. Either my place is cursed with the fact I can’t use drag detectors or it’s just very buggy.

1 Like

@PolyHall It’s unlikely that DragDetectors are very buggy because we’ve got many successful creators and players happily using them.

You’ve probably got a plugin installed that’s stealing your events.

Start simple. Just add a part with a dragdetector below it and click play. If this doesn’t work in studio, but it works when you publish your game, it’s almost certainly a plugin. Disable them all and see if things improve.

If you still have an issue, check if there is anything in your output window when you hit play and report back.

And if the simple demo works, but not your game, then your game may not be cursed, but you may be binding actions with ContextActionService that are stealing the mouse events. Try returning Enum.ContextActionResult.Pass from any actions bound to the mouse and see whether that lets them fall through to the DragDetectors.

Please let us know how it goes.

3 Likes

@PrinceTybalt Why is this happening to me? Is there anyway to make it smoother? https://youtu.be/XNfZh0SwwlI Edit: How do i make this so it doesnt go very far I want it to stay in front of the player.

2 Likes

@xxoof_oofoofxxALT I assume its the jumpy-jittery up-and-downiness that bothers you? It’s hard to tell without seeing the contents of the scene. It might be colliding against the wall or something in an odd way? Or it might be this issue. If you share an rbx file that shows the effect, I will take a look.

As for “How do i make this so it doesnt go very far I want it to stay in front of the player.”
there are two things to consider:
First, here’s a reply to the main announcement that talks about ways to limit how far you object will go when you drag it in a plane.

Secondly, check out and/or download the Lift and Carry sample world or the Lift and Carry - Physical or Lift and Carry - Geometric models that are described in the main announcement. They move approximately in the style of the Lumber Tycoon dragger.

1 Like

Dang, didn’t think any of my old code was still usable. Nice.

I originally planned on rewriting everything in TS and putting it on GitHub since it’s a much better workflow, but never got around to doing it. So best option is just my Roblox inventory.

Be wary though, I never intended it to be used in anything too serious. It’s far from optimized (e.g. the neighbor search algorithm is O(n²) for any given BoidGroup. So use multiple groups whereever possible). Will be the first thing I look into if people actually use it in any serious projects.

Glad you like it though, they’re fun to play around with

3 Likes

It’s great to hear from you. I’ve just used your boids code to play around a little, and yes if you make big groups it does get slow. But it’s so much fun.

I wrote some boids/particle code back in the day when I was working on Shout3D (a java game engine that nobody knows about anymore; we wrote it so that we could deliver 3D graphics without a plugin back when every browser ran java), It was just as inefficient as yours!

3 Likes