Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
avatar image
7
Question by Jonesy19 · Feb 28, 2015 at 09:51 PM · spriteunity 2dparticle systemsorting layers

Unity2D Sorting Layers with Particle Systems

Hey Everyone, I have a problem here that's very frustrating, and I'm thinking (hoping) it's because I'm doing missing something very obvious. I'm using Unity2D and I have a particle system. The problem is simple - The particle system runs and works, but the particle system displays behind every single gameobject. No matter what I do, I can't get it to display in front of any sprite. In fact, it is even hidden behind the background. In case you are saying to yourself, "This question looks familiar", you are right! It's been asked (and answered), but I have not been able to find a solution that works for me. The main solution I have found is to change the sorting layer name of the Particle System. I have done that, but it does not work. Here is my code:

 this.GetComponent<ParticleSystem>().renderer.sortingLayerName = "Enemy";

Does anyone have any ideas?

Thanks!

NOTE: I am using a Shuruken Particle System

Comment
Add comment
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

9 Replies

· Add your reply
  • Sort: 
avatar image
29
Best Answer

Answer by Kazenojin · Aug 05, 2015 at 07:57 AM

I think i got it. Go to renderer in your particle system and change Order in Layer to amount u need. Works for me perfectly.

alt text


screenshot.png (52.1 kB)
Comment
Add comment · Show 6 · 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 Olliepm · Jul 09, 2016 at 03:03 PM 0
Share

This solved for me.

avatar image tfishell · Feb 20, 2018 at 03:44 AM 0
Share

Thank you, I never would have solved this on my own.

avatar image MagoParodi · Feb 26, 2018 at 07:24 PM 0
Share

Thanks a lot!! really helpfull =)

avatar image Jonesy19 · Jul 12, 2018 at 10:36 PM 0
Share

Unfortunately, this doesn't work in my case. For some reason, it won't take on that sorting layer unless I remove the SpriteRenderer and add it back (as mentioned in my answer). In general, though, this solution is the correct way to sort a particle system.

avatar image Leagrove · Apr 22, 2020 at 03:55 PM 0
Share

lol im so blind i didnt see the there is order in layer there

Show more comments
avatar image
4

Answer by Jonesy19 · Mar 31, 2015 at 04:22 PM

I finally debugged the issue and have come up with a workaround (though, I'm not really sure what the exact cause is. I think it might might actually be a bug in Unity.
Anyways, it deals with the SpriteRenderer and the order in which it is applied to the gameobject (relative to the Particle System)...In my case, I was trying to apply a particle system to a gameobject that already had a SpriteRenderer component attached to it. For some reason, this eliminates any possibility of putting that Particle System in any sorting layer other than the one that is furthest back. The workaround I found was to remove the SpriteRenderer, and then add it (or just create a whole new gameobject and add the Particle System first). After doing this, I was able to change the sorting layer of the particle system. Another workaround would be to create a separate particle system gameobject and attach it (as a child) to the main gameobject.

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 PabloUnityArgentina · Oct 15, 2015 at 10:06 PM 0
Share

Yes, that solved my problem! Thank you very much!!

avatar image
3

Answer by gkomaragunta · Oct 31, 2018 at 12:51 PM

I know this is an old thread, i'm putting a work around here:

Alternatively, you can specify when your particle system has to be rendered. You can check the particle systems rendering order in frame debugger and if you want to push it front, you can increase renderqueue value by increasing the Custom Render Queue value. alt text


screen-shot-2018-10-31-at-60957-pm.png (49.0 kB)
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 rCopat · Jan 03 at 01:24 PM 0
Share

Thank you!!! Nothing else seemed to work but this did.

avatar image
2

Answer by BomboBombom · Jul 06, 2016 at 02:26 PM

I had a similar issue with Canvas where particles would render above my UI, even if I put the particle system at a sorting layer that was under the UI. I solved this by changing the sorting order layer on the canvas to 1 instead of 0.

I'm not sure if a similar solution would work for 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
avatar image
2

Answer by dreg_master · Jul 02, 2018 at 02:45 AM

alt text


untitled.png (19.9 kB)
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
  • 1
  • 2
  • ›

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

18 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

Related Questions

How to merge Sorting Layers ? 1 Answer

How do I set the rendering order of objects with the same sorting layer and order? 1 Answer

Sprites rendered in the wrong order 1 Answer

I don't understand why the particle system doesn't change color 1 Answer

Cant access the Image icon from class 1 Answer


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