Collections and game objects aren't scaled correctly

I have a game with two collections of objects that are supposed to be facing each other and have nested objects, so I scale one of the collections by a negative value on the X to have it face the other direction. This works fine in the editor:

Screenshot 2023-01-10 at 7.21.45 am

But in game I get a different result:

The collections are also scaled up by 2, so interestingly the collection scales up correctly, it just doesn’t use the negative value.

Scaling up the root object in each collection instead doesn’t work at all, no scaling is applied in game:

Why does this happen, and how should I handle this?

1 Like

I am not sure why this is, but I would suggest either using

sprite.set_hflip("#sprite", false)

or rotating 180 around the Y axis in the editor (rather than using the scale)

1 Like

The rotation idea works perfectly, thanks!

sprite.set_hflip won’t work in this case, since those are two separate sprites. It needed to be something I can apply to the parent game object/collection.

Seems like a bug to me. Non-uniform positive scale seems to work fine, but any negative scale turns positive at runtime.

My own quick test, in editor:

At runtime: (Bottom left and top right collections should be flipped.)

I think your best option is to put everything on a single root game object in the collection, and flip that at runtime (in init()).