How to set pivot of gameObject on import


very stupid question, but I can’t find any solution.How to set pivot of go in the centre, not top left ?


maybe someone need, this code helped
if (thisGoHC.GetComponent() != null)
Collider2D col = thisGoHC.GetComponent();
thisGoHC.GetComponent().offset =;
thisGoHC.transform.position += Vector3.up * (-0.5f) * col.bounds.size.y + Vector3.right * col.bounds.size.x * 0.5f;

still,is there an easier way to do this right in tiled(for example i don’t know sign of collider offset ±yx)?

(Seanba) #3

Hi BoriYashin, you could write a custom importer for this kind of thing. You can read up a bit about custom importers here:

(See the example of ‘appearing blocks’.)


Thnk You a lot, used this in “handleCustomProps”

thisGoCA.transform.position += Vector3.right * (-1) * thisGoCA.GetComponent<Collider2D>().bounds.size.y / 2 +
            Vector3.up * thisGoCA.GetComponent<Collider2D>().bounds.size.x / 2;