Adding cargo to truck makes game not fluid as before

Hi,

I’m building a cargo truck game. I have terrain and a truck and everything is great. But when I add cargo (box with rigidbody and box collider) on truck cargo space I can see some hard noticable stutterin of terrain when I drive and make a turn. Simply I can see that game is not fluid as before. Cargo is lowpoly, takes 1 draw call and 100 tris / 100 verts, interpolate is on.

Did anyone experiance this before?

“hard noticable stutterin of terrain when I drive and make a turn”

You lost me with “of terrain”. What does that mean? Anyway, generic advice is:

Non-kinematic bodies act on one another. In a “stack” or “basket” type situation, which is what I imagine you’re describing, this can manifest as a shuttering / stuttering behavior, especially when the basket / platform is also mobile. You aren’t making the rigidbody packages children of the rigidbody vehicle, right? Because that would be bad.

If you’ve already tuned the masses, frictions, and bounce factors of your objects to the most realistic figures possible, but you still encounter this problem, the next thing that comes to mind is using a proxy to bypass the problem.

You could move the “packages” to a separate physics layer which collides only with a proxy layer. The bed or box of your vehicle gets an extra kinematic rigidbody collider that exists on this proxy layer. It should have the same size and shape of the actual container. (5-6 box colliders is probably better than a mesh collider for this purpose)

The proxy container object gets its position / rotation from the actual container/vehicle object each frame, but the actual container/vehicle no longer collides with the packages.

Thus the packages will appear to move and respond to the movement of the true container, but the packages will not affect the container/vehicle.

Give this a try and see if it corrects the problem.

Best,