Thought might as well share another workaround while at it. I hope this will be patched soon but until then here it goes. There is a command in Arma 3 setCenterOfMass that allows to shift centre of mass of the model. This is very much needed especially if you are planning on adding a bit of pseudo physics to a helicopter with an attached load. By default the centre of mass will be where it usually is and the load would just swing beneath the chopper like a hand on a clock. Shift centre of mass down towards the load and it becomes a completely different story:
Great! So now you landed and unloaded and want your centre of mass back. Easy, you think, just set it to [0,0,0] and be done with it. Only the thing is, [0,0,0] is not the default centre of mass. Oh no! What to do, what to do? Is there a command for it? Sorry, the developer seemed to forgotten to add the getCenterOfMass command to complement setCenterOfMass. But don’t worry, there is always a workaround. This time we’re going to use positionCameraToWorld command. It seems that when you shift the centre of mass, the camera position also changes as it is somehow connected to it.
So what we need to do is take position of the default camera then shift mass to [0,0,0] and compare the difference. The resulting offset will be our true centre of mass. Easy said than done, because we need to have helicopter in the air, hovering, facing north and in 3rd person view. On top of that we need to measure camera shift at the helicopter for better precision. Luckily there is a config entry that gives us external camera offset, so we will use that. Here is the script:
And here is the video of it in action:
A small note: If helicopter gets stuck in “KEEP IT STEADY” it is because it is probably still climbing. Press Z shortly, this should do the trick. I have measured a few centres of mass earlier, here is my result:
- MH-9 Hummingbird [-0.00976563,0.409668,-0.153938]
- UH-80 Ghost Hawk [0.0634766,2.12988,-0.921791]
- PO-30 Orca [0.0148926,1.15088,0.0233154]
Enjoy,
KK
EDIT: Good news everyone! There is now a dedicated command getCenterOfMass as well as getMass. I took the liberty and compared the Little Bird results calculated by both, the script above and the dedicated command. Judge for yourself:
[-0.00976563,0.409668,-0.153938] (script) vs [-0.00979884,0.409476,-0.159881] (getCenterOfMass).