Author Topic: scaling problem  (Read 2057 times)

Dengao

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
scaling problem
« on: December 03, 2015, 11:05:14 AM »
Hey. When i moving a child-sprite out of his parent, or duplicating an sprite, its scaling goes to 0,0,0. Any Fix for it? its also a problem when i use drag and drop function to move it to a "drag and drop container". The scaling goes to 0,0,0 when it get parentet to the container object.

thanks in advance.

seilz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: scaling problem
« Reply #1 on: December 03, 2015, 11:41:32 AM »
How do you change parents?
Usually you would do something like:

  1. gameObject.transform.SetParent(parentObject.transform, false);

The second param does the trick. It prevents your child from getting modified in scalings.
Read more at: http://docs.unity3d.com/ScriptReference/Transform.SetParent.html