Issue with physics after assigning network ownership to client

I’m having an issue related to physics behaivor of parts when the network ownership is assigned to a client using :SetNetworkOwner(player).

On the client all the physics simulations work fine, and thanks to the Network Owners visualization mode I can see the network ownership is correctly assigned (green outlines indicate client ownership).

However on the server none of the parts are not affected by the velocity changes.
The client currently uses AssemblyLinearVelocity. I also tried using VectorForce and LinearVelocity with no luck.

I’m a bit stumped, normally the physics changes by the client should replicate as he is the owner… But for some reason it acts as if i never set the network owner.

The game has StreamingEnabled if that helps in any way (All the parts are in streaming radius)

I don’t really have any relevant code to show, the relevant parts are the velocity and the network ownership, please tell me if there are any other variables to consider…

1 Like

try applying the Velocity changes on the Client

The velocity changes are on the client.

Is it not possible to just set the conveyor a velocity so the parts move along it? (On the server)

I want the physics to be handled by the client to reduce network traffic, it is currently a very big issue in terms of performance (I could specify that the physics are handled by the owner of the plot but it’s not really relevant tot he issue)

Then i guess you could also do it on the client if you want to

Could it be possible that the BasePart is being effected by multiple velocity impulses?

No I’m just chaning the AssemblyLinearVelocity, one single centralized vector value

Can you test if instead of adding velocity to the part add it to the conveyor and just unanchor the part.

Gotcha gamer. I’d just double check that there’s no active constraints on the part on the server, as that would likely take priority over the player’s ownership.

I’ve changed the AssemblyLinearVelocity of the conveyor belt and it replicated the movement of the parts to the server. Thanks but, why is this happening? Why does it work with the convejor but no the part directly?

Im going to test some things out in my own studio and try to replicate the problem and hopefully determine the cause

Ok so it seems to work fine when i used AssemblyLinearVelocity on the client, if you can could you provide the code used for applying velocity to the part.

it’s literally
self.instance.AssemblyLinearVelocity = velocity
Unfortunantly there is nothing special, just the code that calculates the velocity but its not relevant since the parts on the server are still no matter the velocity.
The instance is unanchored on both client and server and is created on the server, the server assigns the network owner ship and sends a request to the client to create a client instance that has access to the instance reference and applies the velocity based on various calculations.

I guess if this bug is happening it must mean there is something weird going on somewhere but i really cant think of any suspicious code, the codebase is huge.

Im not very knowledgeable on the topic but it should replicate to the server and i would i take a look at the assembly ownership section of the network ownership here although it could just be roblox engine jank for all we know.

Ok so after some debugging i found out that if i isolate the part onthe server and apply manually he velocity in the console on the client it works to there must be something that stops replication only when the part interacts with my code. Problem is, i have no idea what code could be the cause, I’ll keep trying…

I have found the issue…

In the client side code I’m creating a WeldConstraint between the actual physics part (the one for which i assign the network ownership and the one i change the velocity of) and a visual mesh…
I though this was going to be fine since the visual mesh is only visual and is welded to the original part. i change the velocity of the right part. But apparently the weld creates a new assembly effectivly rendering the SetNetworkOwner() call useless.
This is not very intuitive behaivor but oh well…

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