Center of Mass does not adjust

When using a physics constraint and making use of linear motion, the center of mass will not adjust accordingly for the parent component. Only when you change the distance between the components with set position while having physics turned off the center of mass gets updated. As you might can imagine a wrong center of mass makes the physics behave not realistic at all.

Now, I would love to fix this bug manually by changing the center of mass in blueprint but there is only a Get Center of Mass node and the Set Center of Mass node is missing! Any other ideas for workarounds are very welcome.

I basically have a ball swinging on a constraint and I need to change the distance with physics (linear motion constraint), while the center of mass needs to change like it does when setting the distance without physics.

I thought I found a workaround, judging from the get center of mass values it is all fixed but the physics behave even more wrong. There seems to be something seriously broken with center of mass.

What I did for the workaround is attaching a component to the parent to change the center of mass by changing the position of that component. In order to have the center of mass updated I have to detach and reattach it every time the position is changed. I made it so that the get center of mass value fits the get center of mass values of when I change the distance of the ball with physics turned off. But even though the value is the same the physics are all wrong. That goes even so far that in some instances the ball will not swing at all anymore.

I know now why my workaround not worked, basically because of another bug. I had also sphere component attached with 0 Mass which is basically only a target for the camera. Even though it has no mass it changed the center of mass on every reattach. I tried to turn of collision of it but that only crashed the whole engine on play. I then turned welding for it off and then it doesn’t change the center of mass anymore.

My workaround is now the following: a extra component that is attached to the parent and get set to the position of the ball every tick while also getting detached and reattached every tick. This then updates the center of mass accordingly to the ball position.

Following bugs are now connected to the center of mass:

  • Constraint change of linear position doesn’t update center of mass at all
  • Attached component change of position only updates center of mass when detached and reattached
  • The amount of mass has no impact on the center of mass
  • A non physics component without collision weld attached on a physic simulated component can crash the engine

Hello,

Thank you for providing information regarding this issue. I have a couple of questions:

  • Could you provide screenshots of your setup?
  • Have you tried this in a newer version, i.e. 4.10/4.11 Preview?
  • Do you have any steps we can follow to reproduce the issue on our end?

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day