How to get the center mass of physics body?

I apply applyforce() to my physical object and I don’t want to rotate. So I set applyforce(0, 0.2 , object.x, object.y). But the object rotates. I think the object.x and object.y is not in the center of the physical object. Can anyone help me how to get the center mass of physics body? Hoping for someone to reply. Thanks in advance.

Hello @kris6567,

This function should give you the values you need:

http://docs.coronalabs.com/api/type/Body/getMassLocalCenter.html

Take care,

Brent

Hello @kris6567,

This function should give you the values you need:

http://docs.coronalabs.com/api/type/Body/getMassLocalCenter.html

Take care,

Brent