Default Pawn Mass is inaccurate

Hi guys,

I’ve noticed that there seems to be an issue with the mass value specified in the default pawn BP.

If I set the mass to be 100:

the mass logged is:

mass_log

This seems to be a glitch of some sort, as reported by another user of this forum.

The glitch seems to be somewhat related to the MeshComponent the Pawn has.
If I set a mass for the MeshComponent but I don’t enable “simulate physics” on it:

Then in the log I will get a very close approximation of the sum of the two masses:
mesh_no_physics_log

If I enable “simluate physics” in the mesh component, the two masses will be substracted:

mesh_mass_physics

By not setting the mass in the mesh component, the value of the mass is way off compared to the one you set.

No idea why this is happening, I’m currently using UE 2.25.1. Maybe it’s a bug of this version of the engine?

I’m not getting that behaviour. Putting one at 1,000 still results in 99. I assume this is just floating point rounding errors.

Could be,

I guess it’s not a big deal though, I can just adjust the mas required to open the door.
I just wanted to report this glitch in case other users also face it :slight_smile:

I would suggest having a separate variable instead as this is a gameplay element. The mass that is currently being used is for physics simulation.

All this can be avoided calling CalculateMass() instead of GetMass().
CalculateMass() return the mass you set for the component, if you set one. GetMass() will always calculate the mass including sub-components. Yes, CalculateMass() gets it, GetMass() calculates it. Go figure.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms