Trying to make a draggable model connected to a rope. In need of help

I am trying to make a system where you can click+hold on a part to drag that part to another part in-game. Both parts are connected by a rope constraint. The use I’m going for is to be able to drag a gas pump hose to your vehicle. When you click the hose to pick it up, you will be able to drag it over to the gas intake on your vehicle. When the hose and the intake collide, they will connect.

I’ve tried scripting some click detectors, so when you click the gas hose, it would “unlock” the hose, allowing you to drag it to the vehicle. That didn’t work, but I’m thinking I just did it wrong

This is the first time I have ever done something like this, and I’m absolutely clueless. After looking through the developer hub, I’m still confused as to how I would be able to achieve my goal.

Does anyone have any tips?
Thanks

1 Like

These resources may help you.

getting the mouse, what its pointing at, what its position is, etc

constraints (for physics, moving stuff, etc)

body movers (for physics, moving stuff, etc, but they are older than constraints)

beam (in case you don’t like the RopeConstraint visual effect, maybe you could use this)

network ownership (does a client or the server control the physics of a part)
-You probably want the client to control the gas nozzle physics

run service
-I assume you will use the mouse to change the position of something. Rather than using while true, I think using .Stepped would be better.

Good luck.

1 Like