When two parts with FrictionWeight = 0 bounce on top of each other, both parts disappear. Sometimes, a giant shadow (like the one in the gif) appears.
After disappearing, their Positions are set to (nan, nan, nan) and their Rotation is set to (nan, 90, 0). Here’s a quick repo, just paste it into the command bar and run.
The friction between two parts is apparently calculated as a weighted average, i.e. (friction0*weight0 + friction1*weight1)/(weight0 + weight1). If the sum of weights is zero, you get division by zero.
A good fix would be to check for weight equality before getting the average: If the weights are equal, apply the friction of either part. If they’re not, use the weighted average.
Apparently my divide by zero guard is not very good. Will fix. Hmmm, I’m trying to figure out the ideal behavior for this. Should they interact as if the friction weight between them is the same (meaning just the average of their frictions) or what the math does now where the result should be 0.
For me the latter would be preferable and makes more sense conceptually. If I have a part without any friction weight then I probably don’t want it to influence the friction value with another part, regardless of that other part’s friction weight. (so also if the other friction weight is 0)