So I want to create a mechanic for my team's game where players are able to hold down mouse button 1 on an item and move it around. The trouble I run into is client to server replication.

Is the best solution to use a remote function to set network ownership of the selected part to the player, then cause the object to try and float towards my mouse with a body mover like line force or body position?

The more responsive this mechanic can be on the client the better.

5 comments

0

just use mouse.Hit.p and yes, use a remote function, you could also use a remote event

0

My struggle is what approach do I use to get the most responsive output. Like what constraints/bodymovers, and should they operate on the client or server. Currently ill be doing everything from the client and I’ll use alignposition to move the part

1

Does the part being moved around need to be seen in motion by other players, or is it a situation like you might have placing furniture in your in-game house, where you can do all the positioning locally (with a local part) and then just send the final location to the server to duplicate, and destroy the local copy?

1

If it has to simulate on the server for everyone, sending position updates via RemoteEvent to a BodyPosition or AlignPosition instance set on the server is probably as good as it is going to get.

0

Yeah it needs to be seen by other players. I'll see if I can get it to work on the client first with alignposition