Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rotating on the Z Axis to Face Objects

Discussion in '2D' started by ConceptMotion, Nov 22, 2013.

  1. ConceptMotion

    ConceptMotion

    Joined:
    Oct 29, 2012
    Posts:
    1
    So, I've been struggling with this issue for a few days. I am building a top down 2D game (using 2D Toolkit) and basically I want to have a sprite face another sprite by rotating on the Z axis (I also need the player sprite to look at the mouse, which is part of the same problem). However, the sprites are designed top down; facing the top of the characters head, so the "face" of the character is actually on the sides facing the X and Y axes (the vertical axis for the game world is along the Z axis). So, when I try to use PlayMaker, or custom scripts to rotate the sprites towards objects, it rotates the front (the top of the head facing the Z axis) towards the objects, which turns the sprites sideways and making them look flat. Is there anyway around this?