Broken Physics while using tons of parts and constraints

Hello! I’m currently working on a physics based game with tons of moving parts. The problem with that is that it really contributes to lag and broken physics. For example, I have a pickup truck that you can load with blocks. When the truck is in motion, the blocks tend to clip through the truck while it’s moving, but return to the truck bed when the pickup comes to a complete stop. Is there a way to prevent this from happening, and to reduce the lag produced?

2 Likes

The problem is, when you are driving the truck, the parts in the back are probably being handled by the server which is why they appear that way. If you set the network ownership of the parts to the player in charge, it should look better for the player.

2 Likes

Does that mean I need to someway make the parts exist client-wise? If that made any sense? Lol

Basically, when you do :SetNetworkOwner(), it makes the part calculated and processed on the client side so for the client it will look nice. You could just find the parts touching the truck bed and set their network owner to the player driving. Also, make the car have the player as network owner, it helps with latency as well since you don’t have to send a signal to the server first to make the car move. That should help with the clipping issue.

1 Like