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

Sprite depending on Player's position

Discussion in 'General Graphics' started by Grafer, Jul 2, 2017.

  1. Grafer

    Grafer

    Joined:
    May 30, 2015
    Posts:
    19
    Hello.
    What would be the best solution to make object's sprite change depending on player's position?
    I have a 3D World, but my enemies are flat 2D Sprites facing camera (bilboards).
    I've prepared 4 sprites for my enemies (back, front, left and right) and I'm wondering how to make them change depending on where player stands.
    i.e. When enemy is going towards us we see his front, but lets say that enemy is going same direction, but we're standing behind him, we would see his back.
    Should I just use couple of conditions checking where my player is, if distance is shortening or not etc?
     
  2. Grafer

    Grafer

    Joined:
    May 30, 2015
    Posts:
    19
    is bump working?
     
  3. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369