Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Olhur · Nov 29, 2015 at 04:46 PM · spriterenderinglightsorting layerssorting order

Halo hidden under the sprites

Hello!

I am a Unity3D beginner and trying to create a 2D game. I have prepared a small test scene and decided to work a little bit on the visual effects for the player character and then a problem occured.

My player character game object has a Halo component (I have also checked with Light with halo turned on, the effect is the same regardless). Although the the Halo renders, it shows behind the sprites of other game objects in the scene. Manipulating the Sprite Renderer's Sorting Layer and its order does not change anything (and I don't think it should, since this is a renderer for the sprite) - every other object has its sorting layer set to "less visible" (the character sorting layer is "on top" of all of them, meaning it is on the end of the list of Sorting Layers).

So, is there any way to allow the order manipulation on the light rendering within a 2D scene? I have to mention, that I've tried custom scripting fix just like in http://answers.unity3d.com/questions/577288/particle-system-rendering-behind-sprites.html but this way is considered obsolete by the Unity3D editor compiler.

Best regards!

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ex3me · Nov 29, 2015 at 09:48 PM 0
Share

Could you post pictures of how your error looks like and what effect are you trying to achieve?

avatar image Olhur ex3me · Nov 29, 2015 at 10:01 PM 0
Share

screenshot of the current situation

As you can see on the picture, the halo itself is rendered, but things in background (both ground and trees) are not behind the rendered halo, but on top of it. I would like to have this halo rendered on the same sorting layer as character sprite is. Is it doable?

fz.png (69.2 kB)
avatar image ex3me Olhur · Nov 29, 2015 at 10:12 PM 1
Share

Does it need to be halo component? Can't you just draw 'halo' as a sprite (maybe add some self-illu$$anonymous$$ation to it) ins$$anonymous$$d? Alternatively, if you want to produce a fog-like effect that will be there throughout the entire level, you can just create a 'filter' -- sprite, or semi-transparent UI element which will be a child of camera, with sprite, you can set up it's 'depth' in sort layer, with UI element it's gonna be rendered in front of everything I believe

I think the halo effect is not 2D in unity (again that's just my impression), so you might try to attach it to separate object and move its Z-axis, see if it changes anything

Show more comments
Show more comments
avatar image Olhur ex3me · Nov 30, 2015 at 12:34 AM 0
Share

I have to admit, that this may be the case - Halo may simply not be the "2D" component. When switching view to "isometric", I can see that halo (both basic one and this one included in "Light" component) are shown at some different Z coordinate. Unfortunately, changing Z does not change a thing, since sorting order has a priority when evaluating rendering hierarchy. This means, that the best way to deal with it for now it to use sprites and animate them, but... there's gotta be a better way, and if I find it, I'll put it in this thread.

Thanks for your help @ex3me !

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by NGGProgress · Oct 09, 2019 at 11:22 AM

I fixed this problem by creating new material for the sprite behind which the halo was hidding. The new material was: Shader: Mobile/Particles/Alpha Blended, Render Queue: AlphaTest - 2450 This material does not affect the quality of the sprite and makes the halo gameobject visible. I am using Unity 2018.2.20f1.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by zbrtcchr · Jan 24, 2016 at 09:12 AM

Hi @Olhur , has a solution been found for this problem?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Olhur · Jan 24, 2016 at 09:50 AM 0
Share

Hi @zbrtcchr, unfortunately we are still having the same issue, also with other 2D Renderers (i.e. Line Renderer) - no solution for now, we have only partially replaced some effects with animated sprites.

Best regards!

avatar image
0

Answer by Beastman632 · Feb 12, 2018 at 10:46 PM

It seems the shader the Sprites - Default material uses causes this behaviour. Create your own material and set its rendering mode to Cutout and shader to standard. This will allow halos to show in front of your sprites.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

46 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I want to 2d sprite sort layers but force some of them to render in front of another layer? 0 Answers

Sprite sorting order, background behind middleground but in front of foreground 1 Answer

PLease help, I need to render a particle system on top of an overlay but behind the buildings ,PLease help with render on top of sprite renderer but behind of another 0 Answers

How to continue material between sprites. 1 Answer

How to Change the Sorting Layer of Tk2dsprite ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges