I’m customizing a DragDetector by using AddConstraintFunction, setting its ResponseStyle to Custom
, and connecting to DragContinue to update the dragged assembly myself.
The DragDetector has its ReferenceInstance set to an Attachment that does not move with the dragged assembly. This means that even when I use the DragDetector, the ReferenceFrame does not change, which I can verify using GetReferenceFrame.
Now the part that’s giving me trouble.
Functions passed using AddConstraintFunction are given a CFrame value from the DragDetector which is the proposed motion relative to the ReferenceFrame, as per what the documentation says. From my understanding, this should mean that the DragDetector’s proposed motion should always be relative to my Attachment, which is the current ReferenceInstance. Therefore, if I:
- Drag a little bit
- Then let go
- Then start dragging again
The immediate proposed motion should be the same as it left off from the last drag, since the ReferenceInstance has not moved. This is not the case as far as I am currently observing.
Is my understanding wrong? The documentation just unclear? If anyone knows please tell me, it’s driving me insane.
Below is an attached place file with a basic setup that imitates mine and exhibits the exact issue. Run the game and drag the yellow part around to observe the prints in the console which showcase the ReferenceFrame.
DragDetectorIssue.rbxl (57.6 KB)
Side note: I am wanting this behaviour so that my Attachment can serve as an anchor that does not move. Then I may reference it when updating CFrame for the DragDetector in order to avoid floating point inaccuracies over lots of time.