Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to sync the cframe with the server and client?

There is always a delay on the server and client, and so when I cframe the humanoidrootpart, it would look like I'm lagging on the screen of the client.

character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.Position - Vector3.new(0,character.HumanoidRootPart.Position.Y,0), hit.Position - Vector3.new(0,hit.Position.Y,0)) * CFrame.new(0, 3.2, 0)

The code above is inside of a server script and is ran when a remote event fires.

How do I make it where the cframe looks smooth on the client-side?

1 answer

✓ Accepted answer

Network ownership is transferred from the server to the client, and the physics are calculated on the client instead. This transfer causes a small delay. There is, however, a way to fix this: SetNetworkOwner()

SetNetworkOwner is pretty simple to figure out. You set the network owner. Setting it to nil will actually set the owner to the server, ensuring there is no delay.

(Site.)

Note: Use SetNetworkOwner() on the part.

This discussion is preserved as it was. New answers, comments, and votes are closed.