Help with drag system

Hello everyone,

I’ve been trying to make a drag system like the one in Dead Rails, but I ran into some problems. I first used a DragDetector to drag parts in the air, but it doesn’t have a max distance. So when I walk backward, the part just keeps getting farther away, which doesn’t match the Dead Rails drag system.

Then I tried using client and server scripts, but firing too many remotes causes lag. Does anyone have an idea on how to fix this or a better way to do it?

Thanks!

I might be wrong but I swear drag detectors have a max activation distance.
It’s called max activation distance

image

right but u when u walk backwards it does not stay in one place it just gets farther away

So when you go backwards the activation distance doesn’t work?

no i mean while u are dragging part and walking backwards part stays in same place and dont follow you

i already fixed problem using client and server script firing remote many times did not cause any lag it was my mistake

2 Likes

Hello! Could i maybe ask on how you did the script? ive been trying to make something similar too.

1 Like

sorry for the late reply! So, what I did was detect when the player clicks on an object, then send a message to the server to start dragging. On the server, I use AssemblyLinearVelocity to move the object smoothly based on the mouse position, and AssemblyAngularVelocity to rotate it if needed. When the player lets go, I just stop updating the velocity and reset everything.