Hello Guest

Author Topic: Sprite default rotation  (Read 3510 times)

Finblast

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Sprite default rotation
« on: July 05, 2013, 06:34:38 am »
Hey guys, I'm currently trying to make a top down 2d game and I was wondering if there was some way to set the 2D sprites to face towards the Y-axis, instead of the Z-axis. Since my camera points down the Y-axis, the sprites are invisible to the player in their normal rotation. I know I could do this by rotating the gameObject that the sprites are attached to, but this really makes the coding much more difficult in the long run (can't use transform.forward and so on).

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite default rotation
« Reply #1 on: July 05, 2013, 09:04:32 am »
No, you can't switch the default orientation. There is a lot of code in 2D Toolkit that assumes the XY orientation - adding support for other orientations would seriously increase code bloat. 2 options if you think this really makes it much more difficult - make a wrapper to the transform functions to support this orientation (most efficient) or, create an empty game object, create the sprite as a child and then rotate the sprite. You can then move the parent gameobject as though it wasn't rotated.