I have a collection with a root object called “game”. There are creature objects which are spawned through factories that are parented to a child of “game”. Here’s how they look normally:
Since I can’t set an x-scale of -1, in order to flip the world I’m setting the rotation of the root “game” to 180° (i.e. π radians) in both x and z:
go.set_rotation(vmath.quat_rotation_x(3.141592653) * vmath.quat_rotation_z(3.141592653), "game")
But the positions of some (not all) factory-created children are now off-by-one in x and/or y:
All of the creatures have shifted up one pixel, half the stingers of the jellyfish on the left have shifted one pixel horizontally (the stinger is made up of multiple game objects each with an 8x8 sprite), one of the fish has shifted horizontally etc.
The positions of everything that was already a child of “game” in the collection are still pixel-perfect, only dynamically created objects through factories suffer from whatever is causing this, perhaps a precision error? My game is very low resolution (128x128) so a precision error might not have been noticed until now, I’m guessing.