Local physics simulation flings players into oblivion with more complex vehicle assemblies

So I have a big player-controlled truck. It consists of 6 different assemblies, a spinner, four wheels and the main body. This is what it looks like in studio with “Are Assemblies Shown” enabled:

Everything is also part of the same mechanism:


The wheels are connected with cylindrical to the main body assembly, and the spinner is connected with a hinge constraint connected to the body.

Using this setup, about 40% of the time that the big spinner touches a player-controlled object owned by someone else they will get flung away with a velocity completely disproportional to how fast the truck was moving, as demonstrated here: (other 60% nothing happens)

If you check the velocity property of a part on this spinner object it’ll appear as constant (0,0,0) on the server and something that updates about once every 10 seconds on the client. I haven’t checked these properties in live servers but I have confirmed and recorded that the fling bug happens there too if that’s to any help.

The flinging also happens no matter if the spinner is spinning or not, in the video the ActuatorType is set to Motor with an AngularVelocity but the same thing happens if it’s set to none.

The reason I’m tying this to local physics simulation is because if I add a BodyGyro to the small car it will completely fix the issue. This disables local physics simulation as explained by @Khanovich in an earlier post: Physics interaction between player controlled objects isn't working properly - #2 by Khanovich (I’ve confirmed that it’s actually disabled when testing this using “Are Owners Shown” set to true)

I can’t tie this bug to a specific date however since I developed the vehicle a few days ago and haven’t made anything similar before. Feel free to DM me if any repro files are needed!

3 Likes

How massive is the big truck compared to normal cars?

Truck is about 254x more massive.

Car mass: 214.74223824963
Truck mass: 54621.019546289

The spinner has a mass of 18264.886446476

1 Like

So high mass ratios like this cause issues in the solver over all. The only reason “Local Simulation” allows this to happen is because with it off, your truck is essentially colliding with an infinitely massive object so it isn’t able to collide with it with any significant force or velocity, so the interaction between the objects doesn’t really happen.

In real life the ratio of those vehicles would be closer to 1 to 20 rather than 1 to 200.

Later today we should have a post up discussing some guidelines to follow when designing games with the solver, and there is a section that describes high mass ratios and issues that come from that!

Ah okay, makes sense. I’ll definitely lower the masses a bit!

I have another vehicle in the game though which comes in at about 230x more massive than the car, with just a main body assembly and 4 wheels. This one has fairly stable collision, and same with the truck if you hit the car with anything else than the big spinner.

Should the spinner really cause this big of a difference just because it’s a different assembly?

1 Like

I think the spinner is a problem because of the kind of geometry it is likely to produce during collisions. The spinner is more likely to generate collisions that have downward pointing normals for the car you are running over.

This means the car you run over is pinched between the roller, with a collision normal that points down, meaning it wants to be resolved into the ground, and at the same time the car is also being pushed up by the ground. You end up with 2 extremely high opposing forces that end up causing this crazy fling.

With other cars, you probably get collision normals that point perpendicular to the floor, so you don’t get these crazy opposing forces.

Try making a stack that looks like this:

  • Top Layer: 100 Density block
  • Middle Layer: 0.1 Density block
  • Bottom Layer: Baseplate.

In this case the middle part will do some crazy stuff. However if you change this setup to be the 100 Density block pushing the 0.1 Density block from the side, you won’t see the same craziness. This is a similar situation to what you are seeing.

We’re not satisfied with the mass-ratio issues ourselves, the LDL-PGS release last year resolved some of these problems on some constraints, but collisions are still a problem. We’re looking for ways to resolve them, but it requires some significant research, since no solutions exist for this problem without switching to a completely different solving formulation, which has its own downsides.

2 Likes

Sorry to bother again. But I’ve been testing been testing these with solutions and done some more experimenting and it doesn’t seem like the mass ratio was the issue. I tried lowering the mass ratio as low as 14x the car weight and it had no effect on the glitching apart from making it a little harder to trigger the shoot-aways, but when those happen they are still as severe as they appeared in the video.

However, it seems that if I weld the spinner to the body the issue completely stops and everything is completely stable at the previous 254x ratio. It also seems like I actually don’t need to hit the car with the spinner, as long as the body and spinner aren’t welded together I can hit the car in reverse with the truck for example and it will produce the same glitches.

1 Like

Since yesterday I have also been having similar issues, although for some reason I can only get this to happen in game, not in studio. I have a system in my game which welds a model of the tools that you have equipped to the your back when you are placed into a round, and since yesterday it has started flinging everyone off the map with a certain model. I have tested other models but so far there is only one that seems to be triggering this issue. All of the models that are welded to your back have CanCollide set to false for each of the parts, and I tried setting the problematic parts to Massless but that didn’t seem to fix it.

Here are some GIFs of the problem:

In game with the model causing me to be flung: https://gyazo.com/f4e1dbce282fa7dbbd7b5cd0cae92432

In studio with the model causing me to be flung: https://gyazo.com/5631836100bf61256ce105763a82d8a6

In game with a different model that does not cause me to be flung: https://gyazo.com/1e6d4a431a1ca4c23708ac47d7b25ecc

The issue is still occurring for me and it’s starting to seriously halt my development progress. I’ve been messing around with the properties for the parts in the problematic model but I still can’t seem to find a fix. So far this issue is still only occurring with one model for me.

I’ve created a demo place to showcase the bug in action. If it doesn’t fling you as soon as you hit the ground you should just have to walk into a part to trigger it. https://www.roblox.com/games/3318802060/Physics-Bug

Interesting. Is there any chance you can send me models over PM that I can just hop into and drive around the of the two interacting vehicles? If it isn’t the mass ratio at the source of the problem I would like to verify and test some things myself.

1 Like

Sure, sent you a repro file in DMs

2 Likes

Don’t necrobump bug reports with unrelated issues!