Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 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
10
Question by Benzor · Nov 25, 2014 at 04:30 PM · 4.6particle-system

How can I draw a ParticleSystem over the new Unity 4.6 UI?

I want to play a particle system (of 2D sprites) in the UI I am currently making, using Unity 4.6 beta's new UI system. The UI has a solid colour background so I need to somehow modify the draw order such that the particles play on top, but I am not sure how to do this.

Here are some things I've tried:

  1. Changing the Z position in the inspector.

  2. Changing the Layer in the inspector.

  3. Changing the Sorting Layer programmatically via an attached script.

  4. Parenting the ParticleSystem to a Canvas and overriding its Sort Order.

  5. Changing the shader used by the ParticleSystem.

Nothing seems to work so I must be doing something wrong. Does anyone know how to make the ParticleSystem draw in front of the UI?

Comment
Add comment · Show 1
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 smoggach · Nov 25, 2014 at 05:13 PM 0
Share

I haven't actually tried 4.6 yet but I didn't see camera depth on that list. How does the 4.6 gui handle camera depth?

Render your particle system to a camera that has a higher depth than the one rendering the gui.

12 Replies

· Add your reply
  • Sort: 
avatar image
27

Answer by Oris · Mar 04, 2015 at 02:40 PM

In Render Mode of your Canvas, place ScreenSpace - Camera with Main Camera in Render Camera.

Comment
Add comment · Show 3 · 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 Lalit-twistfuture · Apr 13, 2016 at 08:13 AM 0
Share

not working .still particles hide behind the Canvas

avatar image blueknee Lalit-twistfuture · May 18, 2016 at 07:15 AM 2
Share

It works for me. $$anonymous$$ake sure your SortingLayer of the ParticleSystem(in the Renderer pulldown) is higher than Canvas's one.

avatar image ersingulbahar blueknee · Dec 28, 2019 at 01:25 PM 0
Share

thanks for details :)

avatar image
10

Answer by atr0phy · Mar 28, 2015 at 04:15 AM

It's actually pretty simple once you get it figured out. There's a few different approaches you can take; here's one:

  1. Create new scene.

  2. Set camera projection to ortho. Leave its position at 0, 0, -10.

  3. Create your canvas, add some elements if desired.

  4. Set canvas' render mode to World Space (this makes it easier to anchor particle systems to canvas elements, since canvas element positions are all relative.)

  5. Set canvas' position to 0, 0, 500. Don't worry, the canvas won't shrink. I'm setting its posZ to 500 since my particle system ejects particles along all 3 axes [see image below.] This will prevent particles from being accidentally thrown behind the canvas and obscured. alt text

  6. Jump back to the camera, increase its Size property until it encapsulates the entire canvas in the game view.

  7. Create particle system, set its position to 0, 0, 0.

  8. Increase Start Size of particle system, since it may be too small to be seen easily. I set mine to 100.

  9. Test your scene. If the particles are being hidden shortly after spawning, or if you're having any other visibility issues, set the viewport to 3D to help you get your bearings. Be mindful of the rotation of your particle system, especially if you're throwing particles along a specific vector.

  10. Here is a gameview screenshot of my final result: alt text


example2.jpg (182.4 kB)
example1.jpg (141.6 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 Lalit-twistfuture · Apr 13, 2016 at 08:13 AM 0
Share

not working .still particles hide behind the Canvas

avatar image
8

Answer by lilboylost · Dec 14, 2014 at 04:23 AM

Canvas Render mode to "Screen Space-Camera"

Add Sorting Layer Keep all sorting layer at order in layer "default" "0" Animation canvas at higher number.

This has worked for me. It does not work if any canvas have order number non-zero(probably a bug)

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
8

Answer by U_Ku_Shu · Aug 08, 2016 at 07:25 PM

Particles will be foreground to other UI element's if you do the following steps:

alt text

Also you can use this addon:

https://www.assetstore.unity3d.com/en/#!/content/16505


particlessolution.png (70.9 kB)
Comment
Add comment · Show 5 · 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 LilGames · Aug 20, 2019 at 04:46 PM 0
Share

This doesn't seem to work in 2018.4. Can you verify?

avatar image ryanscottmurphy LilGames · Sep 07, 2019 at 03:18 AM 0
Share

It works for me in 2018.4.8f1. $$anonymous$$ake sure you're creating a sorting layer and not a custom User Layer. Note that this does not render over your canvas if it's set to Screen Space - Overlay, only if it's set to Screen Space - Camera. And your particle system must not be under your UI Canvas hierarchy.

avatar image Yiming075 LilGames · Apr 24, 2021 at 06:50 PM 1
Share

You need to change the render mode of canvas to screen-space camera.

avatar image ryanscottmurphy · Sep 07, 2019 at 03:18 AM 0
Share

Thank you.

avatar image mchts · Sep 20, 2020 at 09:01 AM 0
Share

2019.4.10 and works. Awesome. Thanks!!

avatar image
1

Answer by Kiwasi · Nov 25, 2014 at 05:27 PM

A world space canvas works. Not ideal, but it works.

Comment
Add comment · Show 2 · 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 Umresh · Dec 29, 2014 at 07:09 AM 0
Share

It doesn't renders the shaders in particle tab. If you change the material to transparent/unlit cut out it works. I have Image(UnityEngine UI) as BG and i want to show particles over the BG.

avatar image GuruJeya14 · Nov 30, 2017 at 10:02 AM 0
Share

Worked for me :) Thank u

  • 1
  • 2
  • 3
  • ›

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

47 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 avatar image

Related Questions

Particle System and the new UI 0 Answers

What is the "correct" way to switch UI panels - 4.6? 7 Answers

How to get player id's from owners name? Pun network 1 Answer

Text wobbles as Content changes 2 Answers

Get status of GUI Button 4.6 2 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