Hello Guest

Author Topic: Change sprite anchor at runtime?  (Read 4746 times)

dustinbahr

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Change sprite anchor at runtime?
« on: October 08, 2012, 06:19:35 pm »
Is it possible to change the anchor point of a sprite at runtime?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Change sprite anchor at runtime?
« Reply #1 on: October 08, 2012, 07:02:12 pm »
No you cant, but you can work around this by creating a gameobject as a parent, and making your sprite a child of it.

marceloSpiezzi

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Change sprite anchor at runtime?
« Reply #2 on: November 19, 2012, 10:37:14 pm »
Can you explain better how to achieve this ?

I'm trying to do this but when I change the transform position of the object it ignores the position relative to the Anchor Point and moves the object as if it is not parented to the Anchor Point.
« Last Edit: November 19, 2012, 10:50:08 pm by marceloSpiezzi »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Change sprite anchor at runtime?
« Reply #3 on: November 19, 2012, 11:44:02 pm »
@marceloSpiezzi - could you post some more details, maybe a pic of the hierarchy? I'm not exactly sure what you mean.