Best Practicies for Setting A Sprite's Position Separate from its GameObject's Position

Hello Unity Community,

I am wondering what is the best way to set the position of a sprite separately from its parent gameobject?

From my research so far, it looks like the only way to achieve this is to create a child gameobject, add the sprite to that child gameobject, and then modify the child’s transform relative to its parent. However, before I do that I wanted to see what secrets the wise masters of the forums may have in store.

Some context:
I started making a 2d runner game with placeholder art assets, and from these I derived some very specific measurements for how the player gameobject moves around. Now that I’m finally getting real art for the game I’ve discovered that my sprite is a little bigger than my placeholder art was, and since position is set from the center of the sprite it means my player character’s position appears a little off. I am loathe to change the player gameobject’s position because it would mean A LOT of work in redefining the relative positions of all things the player character interacts with, hence I am trying to see if I can simply offset the sprite’s position slightly to compensate for the new art assets being slightly larger than my placeholder ones.

Please share any ideas you may have, and thank you for your assistance.

@gantoine

“I am trying to see if I can simply offset the sprite’s position slightly to compensate for the new art assets being slightly larger than my placeholder ones”

You can offset your sprites pivot in sprite editor, sprite will have its 0,0,0 in this location relative to its GameObject.

1 Like

Thanks eses, that did the trick.