Set Network Owner Not Replicating

Hi, I setted the networkowner of every basepart in my vehicle to my player but for some reason, the body force is different on the server.

Server:

Client:

Notice how on the client the Force is 0, 0, 0, but on the server it’s something else.

How can I fix this?

1 Like

I’m guessing that the client set the BodyForce to 0. That change does not replicate, regardless of network ownership.

I guess it’s also worth saying that NetworkOwnership only tells who gets to determine the CFrame of each part (and maybe a bunch of other physics-related stuff, like Velocity/AngularVelocity). That’s it. It doesn’t mean that ALL changes made by whoever owns that part get to be replicated.

How do I go about solving this issue?

What do you want to happen? What are you trying to achieve in the first place?


I’m working on car suspension using body force in each wheel and a raycast to detect.

When the raycast doesnt detect anything, I want to cut the forces.

Does the server even need to know about the BodyForce? Create and manipulate it locally. It will still work assuming that it’s parented to something that the player owns.

Really, having the client create the BodyForce isn’t even necessary in the first place. Even if it was the server that created the BodyForce, local changes to the BodyForce (assuming that the player owns the part that it’s parented to) will still apply.

But I thought i the server created the bodyforce, setting it to 0, 0, 0 wont replicate

it seems to work when the client creates it

The number itself won’t replicate to the server, but since the player owns the part it’s parented to, the force will still be applied.

Hm, thats weird bc when I cut to force in the back two wheels the vehicle’s but wont drop.

Instead of cutting the force, mind setting it to something outrageous like (0, 100000000, 0)? Maybe something else went wrong.

Same for the two front wheels. When it slides off the ramp, the two front wheels no longer have a surface to detect so it cuts the force. the front eventually drops, but it just drops really slow, I don’t know why.

Maybe I’m doing something wrong with my suspension equation? Should I post it here?

Can you confirm that local changes to the wheel are actually being applied to the part? Whether or not your suspension equation works is a different question.

Hm, it is. Here is another example:

https://i.gyazo.com/f98d523c8929db4bab875c6b9d0d726f.gif

Notice how the back doesnt drop even when there’s no force.

I don’t know what’s causing the problem. Do you apply just enough force so that it cancels out gravity? I think the force is being applied to the root part of the assembly, not the parent of the BodyForce, instead.

Hm, maybe it’s how I’m calculating the force then?

And each body force is in each wheel, not the primary part.

Would you like to see the code?

Yes, you’re correct. I’m somehow applying just enough force where it cancels out with gravity.

Yeah, but those wheels are presumably connected to the chassis, and the force is (possibly?) being applied to the chassis instead of each wheel since the chassis is the root part.

Since you’re applying just enough force to cancel out gravity, this causes the entire car to float.

Instead of using a BodyForce, try using a VectorForce (a new-ish constraint) instead, with the force applied relative to the world. This will be applied to where the constraint is instead of the assembly’s primary part.

image

EDIT: I’m fairly sure this would help with your problem. On the left is a VectorForce, on the right is a BodyForce. Each force is applied to the tinier part.

Notice that the assembly on the left looks like it’s being pulled “upwards” by the tinier part, whereas on the assembly on the right it looks like the force is being applied uniformly throughout.

EDIT2: Oh, and make sure that ApplyAtCenterOfMass is ticked, too. Otherwise the force will be applied where the attachment is. Nevermind this is bad advice. Make sure that the attachment is centered on the wheel instead.

2 Likes

Thank you so much! That worked!

https://i.gyazo.com/e9e84b5dc2401cba2dbad58fa2baf67a.gif

Any idea why this works well over body force, even when some people use body force for suspension?