Changing center of gravity of a gameObject

How do I change the center of gravity of a 2d gameObject(using a sprite renderer). Basically what I want to do is make the object rotate around a different pivot point when specified. Any help appreciated.

Some possibilities:

You can change the pivot in the sprite editor.

You can offset it with a hierarchy of GameObjects (offsetting the children)

You could compute the offsets yourself and apply them.

Since you said “center of gravity,” if you are ACTUALLY talking about Rigidbody2D physics then there is a property to set the center of mass… go check the docs for Rigidbody2D.

1 Like