Search Unity

billboard : face X to camera on any Y angle

Discussion in 'Scripting' started by generalhak, Jul 31, 2018.

  1. generalhak

    generalhak

    Joined:
    Apr 20, 2014
    Posts:
    28
    hi
    in line renderer or stretched billboard in particle system if you change the Y rotation, your sprite is rotate around X axis to always be face to the camera
    how can i do that?
    _
    look at this images : camera rotation is 30,45,0 (isometric)
    look how its a 2D sprite but it look 3D
    transform rotation is 0,0,0

    _
    in this image transform rotation is 0,-45,0 (but sprite rotation look like this (30,0,0))

    _
    in this image transform rotation is 0,45,0 (but sprite rotation look like this (90,0,0))

    now look at this image its a normal sprite renderer if i rotate sprite at something around 0,-60,0 (if i rotate the sprite in 90,0,0 then you can not see the sprite)

    i want this behavior (X face to camera in any Y angle) for my bullets (bullets can fire at any direction but must look 3D from top (isometric view)) and effects in the game
    i develop for mobile so i can not use particle system (stretched billboard) or line renderer for my bullets (for performance)
    i'm really stuck in this so thanks for any help.
     

    Attached Files:

    • q1.png
      q1.png
      File size:
      49.7 KB
      Views:
      966
    • q3.png
      q3.png
      File size:
      49.9 KB
      Views:
      926
    • q2.png
      q2.png
      File size:
      38.3 KB
      Views:
      890
    • q4.png
      q4.png
      File size:
      36.6 KB
      Views:
      963