Issue with client server physics replication

Hi all,

I’m trying to create a broom that a player can fly however I’ve run into some trouble with client to server physics replication. The script works by creating a controller part on the client which has its rotation changed by user input (on the client), the orientation of the broom itself is aligned with this part’s cframe with the alignorienation constraint (which is also on the client) - when the broom is created on the server the network ownership of the part is set to the player so its physics are replicated to the server.

When I don’t weld my character to the broom on the server the physics replicate, however when I do weld my character they don’t.

WHEN I DON’T WELD THE CHARACTER:

Client Position:

Server Position:

(As you can see the physics replicate)

WHEN I WELD THE CHARACTER:

Client Position:

Server Position:

4

(The physics don’t replicate on the server, the broom and player remain in the same position)

Any help would greatly be appreciated :grinning:

show the client and the server scripts so I can find the issue in your code

This is the physics part of the client script (the rest of the script is just changing the cframe of the controller part via client input)

1

And this is the server side which creates the broom, sets its network owner and welds the character to the broom

2

Format it please like this

```lua
Put some code here
```

creating local linearvelocity or alignorientation causes replication to become confused, thus stopping server from updating your client position at all
i had that similar issue when roblox added linearvelocity i had it added to localscript to do airstrafing, to notice that it does not accept any physics replication.
solution is to have server create instances related to physics. and let client do the rest.

Problem is the other attachment to the constraint is the controller part which is made on the client (so I don’t have to fire a remote event to the server every time to update the orientation)

I think you should be able to use server instance to change attachment0 attachment1 to ur local attachments.

Tried creating the constraints on the server then setting the attachments on the client and it’s still not working :confused:

I got it, just created all the attachments on the server as well. Thanks for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.