2D Toolkit Forum
2D Toolkit => Support => Topic started by: jrhee on February 03, 2014, 04:15:18 am
-
Hi,
Just wondering if there are any plans to allow baking scale for nested sprites? I'm making modular buildings which are comprised of many precisely aligned, grouped sprites; when I scale the parent transform everything scales correctly, but when I try to bake the scale down to the child objects to keep batching intact, the alignment of the objects breaks.
Thanks!
-
It should work, except in some cases where it can't bake scale - unlikely thats the case in yours though. Can you create repro scene and email support, please? Should be easily fixed with a repro.
-
For anyone else who might run into this, adding the line below fixes it. Thanks Dinesh for the quick fix!
static void BakeRecursive(Transform node, Vector3 accumulatedScale)
{
node.localPosition = Vector3.Scale( accumulatedScale, node.localPosition ); // Add this
-
Its merged into the codebase too, so it'll be in the next release.