AlignPosition physics issue

Alright to put it in simple terms, I’m creating a pickup system involved with AlignPosition that seems to have an issue when setting the NetworkOwner().

THE PROBLEM:
When setting the NetworkOwner() of the part to the server, AlignPosition works fine and is smooth globally but, on the client itself it seems to have a delay issue or the part looks anchored.

Video:

THE SOLUTION:
When setting the NetworkOwner() of the part to the client, AlignPosition works fine and is smooth locally but, on the server itself it seems to have a delay issue or the part looks anchored.

Video:

As you can see, if I were to do it vice-versa the same Issue would occur. Currently I’m having the server handle the replication of the AlignPosition that way it can also replicate the beams which we’re planning on adding textures to it and would like the server to see it as well it handles the currency input and what not.

On the client do only thing I’m really doing is firing a remote to the server of the part nothing more nothing less.

Any ideas of why this is occurring?

2 Likes

You should do these kinds of effects on each client separately.

Have each client detect whenever a character comes close to a part (characters within a certain radius). When a character is close enough, do the animation/movement on that client. You should clone the part on the client, so that it is local.

When the character that is close enough is the LocalPlayer’s character, fire a RemoteEvent to the server with this player’s position, the server can check if that position is valid within a certain range and increment that player’s coins.

The server won’t see the animations, but that doesn’t matter as all the client’s will see them.

You can also add a setting that determines in what radius the animations play for this client, to compensate for lag on lower end devices.

Seems like reasonable solution but the question still remains unanswered? Why does this issue occur with AlignPosition? This is the first time I’ve encountered something like this.

This has likely to do with physics replication.

It is often really hard to perfectly sync physics between the server and every client, due to lag / network bandwidth.

Instead, physics get interpolated at a variable frequency on each client (like tweening).

The animation is likely to fast or there is to much lag.

Are you sure the parts are the same between the clients and the server?

Yes they were at one point, but the it seemed too delay so I just destroyed the part on receiving it on the server and made the server create a new one with the same coordinate, and it seemed to somewhat fix it but not merely enough.