Hello Guest

Author Topic: Scaling sprite groups  (Read 3754 times)

jrhee

  • Newbie
  • *
  • Posts: 10
    • View Profile
Scaling sprite groups
« 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!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scaling sprite groups
« Reply #1 on: February 03, 2014, 10:55:29 am »
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.

jrhee

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Scaling sprite groups
« Reply #2 on: February 04, 2014, 05:14:31 pm »
For anyone else who might run into this, adding the line below fixes it. Thanks Dinesh for the quick fix!

Code: [Select]
static void BakeRecursive(Transform node, Vector3 accumulatedScale)
{
node.localPosition = Vector3.Scale( accumulatedScale, node.localPosition ); // Add this

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scaling sprite groups
« Reply #3 on: February 04, 2014, 05:31:49 pm »
Its merged into the codebase too, so it'll be in the next release.