Download

Why mass changed externally?

Hi, during the BeginPlay event of my pawn, I set the mass by

physicsSM_cmp->SetMassOverrideInKg("physicsSM_cmp",0.48,true);

However, during the tick event, I check the mass by

physicsSM_cmp->GetMass();

the value becomes 1.26089418.

I also tested to set mass to 100, then it became 100.780891 in tick.

Why the mass is changed externally? What the physics engine do at background? How to avoid this kind of things? I am using Physx with UE 4.27.1

To add something I just found, the mass is changed when I attached other components to the physicsSM_cmp, even though I disabled the physics simulation of these component.

attachingSM_cmp[i]->SetSimulatePhysics(false);

And another very interesting thing is if I set mass to the attachingSM_cmp (e.g. 4 attachingSM_cmp, 100kg for each), the physicsSM_cmp’s mass only increase once plus some strange fraction (i.e. increase only one 100kg, with something like 0.234134234).

To be frank, I really do not understand what the engine is doing here.