How to Display Sprite Renderer like GUI Texture in 3D?

I created a Sprite Renderer, it has sprite sheet animation.

I would like to display it like GUI Texture in 3D, i.e.

  • always displayed regardless of the position of the camera
  • display position is given by a screen coordinate
  • display over all other 3D objects

I tried to assign screen position to v2f vertex(SV_POSITION) in sprite shader,
but it displayed at unexpected position and disappeared when camera moved a certain distance.

(When the camera does not move, sprite does not disappear)

How can I display Sprite Renderer like GUI Texture in 3D?

Sorry my English is limited.
I thank you for reading it through.

If you want to use it like a HUD, you could create a separate orthographic camera and put the sprite in front of it. Then set that camera to be rendered last. Otherwise you could write a script to have the texture always face the camera?

I’m not exactly sure how you want the sprite to interact with the world though.

You have to make sure the material attached to the sprite renderer is the Sprites-Default, if you do that, i’m pretty sure they will behave as you wanted