DragDetectors [Beta]

Just a heads up, we don’t see this gameID in the request forum-- we see two others (which has been mentioned in your other reply, and has been enabled).

1 Like

I would love if the reference frame could be set to update before the drag does. Maybe it does and I have somehow misconfigured the DragDetector, but if I set this to my character, a descendant of my character (e.g. my HumanoidRootPart), or an Attachment, then the reference frame is based on where my character was at the start of the drag.

This means that constrained dragging can’t happen relative to a moving object, like my character, which limits how it can be used, especially if the object itself is in a moving reference frame.


This seems like it should be relatively easy to implement if it isn’t already planned or in the works or something which I suppose it very well could be with the implementation. It seems very generalized, and the paradigm was clearly very functional, and, I appreciate that a lot for how easy it makes everything.

For things like velocities, assuming that there is reliance on the velocities making sense for the reference frames, it is totally valid to translate these to the new reference space using the old and new reference frames if they are integral to the math, which, in my mind is the only blocker that I can think of potentially preventing reference spaces from being different.

Performance-wise I also can’t see it being a problem at all, even assuming that attributes need to be updated every single frame, but, I also wouldn’t call that ideal if that is a requirement so I can see why that would be a thing to cause moving reference frames to be turned away from.

2 Likes

Well, that game id/place id, they did end up reply to me and enabling it, so they probably removed the request since it was done

2 Likes

It doesn’t seem to be working in the place, are you sure it’s enabled?

Edit: It works in 14064023538 but not 14045880200

1 Like

Okay the second one should be live now.

3 Likes

Thanks! It is working now! This will help my game a lot :slight_smile:

3 Likes

The value returned by dragDetector.getReferenceFrame() should always be current. It’s not cached and we ask the referenceInstance for it’s pivot at that moment.

So something else may be wrong.
Can you post an example of what you are trying to do and what is going wrong? It may be that if you have a constraint function, it needs to be written differently. Or it could be timing of when the avatar updates is out of sync with when you are calling your other functions?

2 Likes

I’m referring to the MaxDragTranslation, MinDragTranslation, and DragFrame properties. They don’t update/move/change with the ReferenceInstance’s movement, they seem to all be relative to the CFrame of the reference instance when the drag started.

Here’s a little repro for what I’m doing:

  • Create a part.
  • Add a DragDetector instance to it.
  • Set a MaxDragTranslation and MinDragTranslation.
  • Set the ReferenceInstance to your character, your HumanoidRootPart, or an attachment that is a descendant of your character.
  • Attempt to drag the part while walking away. The part will be stopped within the min/max drag translations based on where the character originally was when the drag began.
  • Also observe that the DragFrame near the borders of your max/min drag translations will be approaching the min/max drag translations as you walk away, even if the part remains at the same fixed offset from the ReferenceInstance.
2 Likes

how much longer can this be in beta oh my god

2 Likes

I see. I will look into this and likely file a bug. It sounds like the behavior you want is more correct.

3 Likes

How would this work for people on phones and mobile devices as currently dragging moves their camera

2 Likes

starting a drag on a part creates a black circle on the part you’re dragging which acts as an indicator of where you’re dragging it

so yea

4 Likes

Hey there! I submit a request on the form for my holder account’s project and the respective development place on my account. How long do these usually take?

Cheers!

3 Likes

You can try it now by running DragDetector TestWorld 1 or 2 on your mobile device.
If you click on a DragDetector and drag, the camera will not move.

2 Likes

Are detectors supposed to be unusable in a different collision group?
I think there should be an option to do so regardless…

4 Likes

When you pick things (which is what the DragDetectors do) the cursor itself belongs to a collision group named “Default”

So if you make other collision groups, you need to go into the collision editor and make it so that those collision groups can also collide with ‘default’

Attached is an example that has 2 red blocks, 1 blue block, and a baseplate. The red blocks can collide with the red block group and Default, but not with the Blue Block group.
and the Blue can only collide with blue and default.

There are dragdetectors on all 3 and they all work.

Does this help?
CollisionGroupTest.rbxl (54.1 KB)

3 Likes

I think you misunderstood my question… Is there a way to override the collision groups for the cursor so that you don’t have to change the collisions for Default? My objects sometimes require collision only with the player (not Default group). I was thinking if there could be a way to make a property that can switch the limitations on/off.

2 Likes

There’s no special behavior in DragDetectors to enable this. Is it possible to remove everything from the default group but the cursor? So you could think of default as the cursor’s collision group?

2 Likes

Not really… unless you want the spinners in my obstacle course to collide with the walls and stop.

2 Likes

So if you want the spinners and walls to be in different groups, can’t you make two groups that are separate from default?

SpinnerGroup can collide with default (the cursor) or SpinnerGroup, but not WallGroup
WallGroup can collide with default (the cursor) or WallGroup, but not SpinnerGroup

I’m sure you have much more experience with collision groups than I do, so it may take me a but more to understand why this doesn’t work. Does the problem have something to do with which collision group the avatar belongs to?

2 Likes