How would i achieve instant part movement?

i wanna make a script that changes a part’s position whenever a gui button is pressed (using AssemblyLinearVelocity), however, when i try to do that with a remote event, it works, but it takes a long time for it to happen, i want the part movement to happen as fast as the player’s character movement, i tried doing that in a local script without the remote and i got what i wanted, however am afraid it wouldn’t show to other clients or it would make it easy to exploit it.

You mean that u want the part to move very fast?

Use a tweenservice and get a duration to 0.1
That will move fast

use Server Script in gui
rkdss Programmer

no what i mean is, i want it so whenever a player for example clicks their mouse, it will move a part, however when i do that with a remote event, it will wait a bit of time before doing so (to communicate with the remote i guess)

it works but, if a someone has a slow internet wouldn’t that make it slower for them ? also how about exploiting it ?

You can move the part immediately on the client, and then fire a RemoteEvent to tell the other clients to move it (or to just move it on the server, which should be effectively the same). There’ll always be the slight ping delay between clicking and other players seeing, but it’ll be instant for yourself.

1 Like

I was just gonna say that. :sweat_smile:

hmm now there is a slight lag spike in the movement…
let me explain exactly what am trying the achieve, i wanna make a game where the player controls a part to play, now to make the part’s movement am using part.AssemblyLinearVelocity, when i do that with a remote its slow, when i do that locally it works fine, when i do what you told me to do, its kinda glitchy

Oh, you should use :SetNetworkOwner() on the assembly and set it to the player that owns it. That way the player controls the physics and it’ll be smooth for them and replicate a bit nicer.

1 Like

i tried your idea, for some reason the network owner still switches to the server after i set it, is this normal ? if so, do i have to set the network owner everytime i fire the remote ?

You might need to set the network owner of all parts in the assembly. Make sure you include the player object in the arguments for it.

just a quick question, after i set the ownership, do i still have to use the remote to move the part? because that’s what am doing right now

No. You should be able to control it entirely on the client, and it’ll replicate automatically.

that was why it was switching ownership to the server then.

thanks you for the help !

1 Like