Announcing DragDetectors!

Ok it works now, thx for telling me to turn off plugins!

3 Likes

I had nothing to do after fixing my issue with dragdetectors and so i made default part with secret drawer inside :eyes:
2023-10-14 18-30-32|video
oh damn it didnt get preview

2 Likes

how do i make it so that it doesnt do this stuff

2 Likes

Thatā€™s great, @x_maks441 !
You might get better results with preview if you convert it into an animated gif (and make sure itā€™s under 10MB). I always use this site to do the conversions:

1 Like

@dodleoy if you want to move parallel to the ground plane, but you donā€™t want to be able to drag it so far, then [1] set the dragDetector.ReferenceInstance to be any other object in the scene. Terrain is fine, but if you want to express the limits relative to, say, the pivot of the floor of a room, then make that floor or other object be your referenceInstance [2] set the DragDetector.MinDragTranslation and MaxDragTranslation so that the max is greater than the min.
Now your object will only drag between the min/max values.

There is no scripting required for this, you can do it all with properties.

For example, if you want to be able to drag the object inside a room thatā€™s 20 x 30 in X and Z, you can place an object or attachment or the roomā€™s pivot in the center of the room; set that object to be the referenceInstance, and then set MinDragTranslation = (-10,0,-15) and the MaxDragTranslation = (10, 0, 15). Since the Y values are equal, you can move it up and down as much as you want. Of course, the default DragStyle is TranslatePlane so your dragger wonā€™t be lifting the object and in this case, Y is irrelevant. Thereā€™s an example of this if you look at DragDetectors TestWorld 1 #3B: Move in ViewPlane. The balls canā€™t be dragged above or below a certain height. Or look at DragDetectors TestWorld 2 #5:Slide where the square is kept within the boundaries of a rectangle.

If you want to drag in other planes, you can rotate the ReferenceInstance object and the DragDetector will drag in that objectā€™s new X/Z plane. Or, you can change the DragDetector.Axis which specifies the normal to the plane in which you will drag. For example if DragDetector.Axis is (1,0,0) you will drag in the YZ plane instead of the XZ plane.

Lastly, there are other DragStyle values. TranslateViewPlane will drag parallel to the view plane. And TranslatePlaneOrLine will drag in the plane, but if you press the control key you will drag in the line perpendicular to the plane. And you can swithc back and forth which makes it easy to drag an objects anywhere in the 3D space.

1 Like

How would I create a crank handle? I have two parts, the rotating cylinder that is connected by HingeConstraint to the wall, then a handle that is another cylinder connected to the aforementioned cylinder by another hinge, this also contains the DragDetector. What settings are needed in order to permit a player to grab the handle and rotate it in a smooth motion? In addition how can I monitor the rotation of the crank in order to do things like open a door depending on how much the handle has been cranked?

1 Like

@BusDriverAlmonty if you change the dragDetector.DragStyle to RotateAxis, it will rotate about the Y axis of the pivot of the dragDetector.ReferenceInstance.

In your case, Iā€™m not clear why you want two hinges. Iā€™d think you would connect the first cylinder to the wall with a hinge, and then weld the second part to the first so that they rotate together.
Iā€™d set the dragDetector.DragStyle to RotateAxis; and the dragDetector.ReferenceObject to be the Attachment on the wall, which doesnā€™t change when the hinge rotates and gives you the right spot to twirl around; then. Iā€™d make sure that the dragDetector.Axis is the same as the attachmentā€™s axis that points parallel to that first cylinder, your desired axis of rotation. Easiest way to do this is to select the attachment, select the Translate tool, make sure itā€™s in local mode (command +L toggles between local space and worldspace and you see a little ā€˜Lā€™ when itā€™s local) and then see which axis points in the direction you want for your axis of rotation (red = x, green = y, blue = z). Set your dragDetector.Axis to match.

Thereā€™s no scripting for any of this; you can do it all with properties.

Once this is all set up, you should be able to watch the dragDetector.DragFrameā€™s orientation and see the values changing to decide when to open the door.

If you get this working, maybe post a video or even a small model so that others can see or try it?

1 Like

since weā€™re all plugging in our silly games, i made bowling using drag detectors.

bowlign

I noticed that the part wonā€™t move if you move forward, or into the part. Are there other settings that I can enable to make this happen with ā€˜TranslateViewPlaneā€™, or it is only attainable via scripts?

The action is a little strange. Are you using ā€˜lift and carryā€™ for this? I would not because that keeps it a constant distance, and you want to be able to push the ball.
And TranslateViewPlane would not allow you to push the ball forwards either.

I would just use TranslatePlane in the ground plane so you can roll it forwards at different angles. (This is what I used for the bowling demo in DragDetectors TestWorld 1)
Or you could use ā€˜BestForDeviceā€™ ā€“ this will let VR users move it with 6DOF control; and users with keyboard mouse roll in plane with the extra bonus of being able to lift if they hold the command key.

Oh, no. Iā€™m using a different game for this.

Okay then Iā€™ll need a more thorough description of what you are trying to do, how youā€™ve set things up, and how they are behaving.

https://gyazo.com/309140a7aa29245fe5a4fb7abfdf1e40 The video shows that the object is able to move left and right, and not space out a millions studs away, but you canā€™t make it move forward and backwards.

The question I asked before was if there was a setting on the drag detector that would go hand in hand to solve this problem.

The only setting I have changed from the default DragDetector on the cube is the DragStyle.

What is the DragStyle that you are using?
As I said earlier, TranslateViewPlane does not have a forward component and is not a good choice here.
Please read this post from earlier today about 8 replies up, linked below, for information about how to move objects so they move in the ground plane, but stay within an area.

The DragStyle Iā€™m using is ā€˜TranslateViewPlaneā€™

@xynxae see my answer to your previous post.

Ye and what find you from the tumb and badge I also changed the image from it

Wow! This is quite cool! I think I will use this DragDetector for something in my game!

2 Likes

@PrinceTybalt is it possible to use the drag dector to make a grab toy game like you see in archcades to pick up teddys etc?

2 Likes

How can I limit the total ammount of rotation allowed by a draggable part. I mean in total NOT per drag, since the limits in the detector seem to only apply per drag. Application is a valve that is unanchored and attached via constraint. Another thing that Iā€™ve noticed now is that this also seems to not respect the HingeConstraints ā€œLimitsEnabledā€ property. Iā€™ve attached a place with afformentioned valve. Since I set it to ā€œPhysicalā€ if I read the documentation right, it should be respecting constraints attached to the part being manipulated.
DragdetectorValveRepro.rbxl (92.2 KB)

2 Likes