Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Add depth to a sprite?

Discussion in 'Scripting' started by Carolinetis, Jul 17, 2017.

  1. Carolinetis

    Carolinetis

    Joined:
    Feb 20, 2016
    Posts:
    13
    Hi,
    I am prototyping an idea without an artist, and I need some tricks to get something that works fine visually. I want to be able to move the camera in a 3D environment but there will also be 2D characters there (as my friend and I only know how to animate using Anima2D). We think it would be ok if our character is like a carton print (see image https://ibb.co/gUFWfF) as long as when we look at it from the side it doesn't disappear completely.

    I have been trying to add a mesh to the Sprite, but it gets into conflict with the Sprite Renderer. Another option would be to create a 3D object from the sprite, but then we cannot animate it.

    Any idea on what could I try?

    I think this could lead to a cool style, it would be interesting to try.

    Thanks!
     
  2. Phorsaken

    Phorsaken

    Joined:
    Dec 12, 2013
    Posts:
    27
    A sprite is not meant to have a 3D style view really so I don't believe to my knowledge there is a way to do it and keep it as a sprite. The only thing I could recommend is making the sprite always face the camera. Otherwise to get the effect you want you would have to make an actual 3D object with very little depth to get the effect from the picture you posted.

    -Alexander
     
  3. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Typically you'd have the Sprite always face the camera. If your camera has a lot of free movement then you can have the Sprite face the camera and point World Up so it still appears planted on the ground
     
  4. Carolinetis

    Carolinetis

    Joined:
    Feb 20, 2016
    Posts:
    13
    I want to be able to rotate around the character, so keeping the script facing the camera does not work with the aesthetic purpose of the game. But thanks for your reply!
     
  5. Carolinetis

    Carolinetis

    Joined:
    Feb 20, 2016
    Posts:
    13
    Yeah, that s what I thought, so if that s the only way we will have to forget about using Anima2D... Thanks!
     
  6. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I'd suggest rendering your Sprites with a special shader to add some fake depth and extrude the sprite alongside it's Z-axis.