Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
4
Question by aegodbold · Aug 16, 2014 at 02:23 PM · c#2deffectshalo

Bring Halo Effect to Specific Layer in 2D Game

I'm just going to start off with saying: I have no idea what I am doing at the moment.

I am working in 2D. I have a particle effect with a Halo effect added to it. I cannot get the Halo effect to render in front of the sprites. I used a script to get the particle effect up front, but I can't figure out how to do it with the Halo effect. Here's the script.

 using UnityEngine;
 using System.Collections;
 
 public class SpecialEffectsLayer : MonoBehaviour {
 
 private Component halo; 
     
 
     // Use this for initialization
     void Start () {
         halo=gameObject.GetComponent("Halo");
         
         halo.renderer.sortingLayerName  = "2nd Foreground";
         
     }
 }



I'm sure I'm butchering the syntax. I saw a few different questions on here involving referencing the Halo, but they all have to do with enabling and disabling it.

Here is an image of what it looks like currently (as well as the Inspector). You can see the particle effect is in front, but the Halo is not. alt text

Any help would be greatly appreciated!

capture.jpg (117.3 kB)
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

5 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Ketsedo · Feb 12, 2018 at 10:06 PM

This STILL doesnt have a fix

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 kbumpious · Apr 09, 2015 at 10:17 AM

Did anyone ever figure this out? I have (Unity 5):

This will compile and run but the halo is still behind everything. Im working in 2D.

 private Component halo;
 
     // Use this for initialization
     void Start () {
         halo = gameObject.GetComponent("Halo");
         halo.GetComponent<Renderer>().sortingLayerName  = "Dolphin";
         halo.GetComponent<Renderer>().sortingOrder  = 0;
     }

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 slayer3600 · Sep 30, 2015 at 07:35 AM 0
Share

@aegodbold, @kbumpious did you ever figure out a solution? I would also like to know if there is a solution to this as I am encountering the same issue. No matter which sorting layer the Halo effect is on, it will not render in front of sprites. I see the same questions asked in two other threads with no answer as well:

http://forum.unity3d.com/threads/halo-component-doesnt-work-when-drawn-over-sprites.254892 http://answers.unity3d.com/questions/757589/how-can-i-create-a-halo-effect-on-a-2d-sprite.html

avatar image
0

Answer by MarkD · Apr 09, 2015 at 11:24 AM

You can attach the halo as a separate component or creatie tour own script to place a 2d texture on te location of the light. Then move this texture to a higher draw layer.

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 Beastman632 · Feb 12, 2018 at 10:52 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
avatar image
0

Answer by NGGProgress · Oct 09, 2019 at 11:25 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

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

9 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

parallax on x, But how on the y as well? [Solved] 1 Answer

A hole in ground after explosion [2D] 0 Answers

C# UI list item drag onto 2d sprite in world space? 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