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 /
avatar image
1
Question by ksakins · Jul 27, 2016 at 07:16 PM · 2dspritetrailrenderer

Trail renderer not rendering over sprite background

I'm working on a 2D game and I can't seem to get a trail renderer to appear over a sprite. I have a trail renderer attached to a parent game object (its a projectile). In play mode, I shoot the projectile and I can see the parent object but not the trail. I then disable the background sprite, and I can see both the projectile and the trail. I've tried messing with the transform values of the trail, nothing seems to work.

I've seen various questions related to this, such as this one: http://answers.unity3d.com/questions/593897/trailrenderer-coexisting-with-sprites.html

Most answers deal with attaching a script to the renderer or parent object and setting the sortingLayer and sortingLayerName manually. However, none of the proposed solutions so far have fixed my issue.

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

4 Replies

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

Answer by ksakins · Aug 08, 2016 at 01:09 PM

Well, I eventually found the issue to my particular situation, just in case someone has the same problem. So the problem was two things. First, I had to make sure that my trail renderer used particle shaders. Second, I did have to implement the script mentioned in the link above which sets the sorting layer of the trail renderer to above any other sprites that may overshadow it.

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 Gunorgunorg · May 12, 2017 at 05:28 PM

When changing the order in layer you can change the sorting layer as well. So make a new layer and put it above the "Default" layer on the list. Then mark any objects you want the trail renderer(and object creating the trail) on the "Default" Layer and Background objects in the other layer. I use a trail renderer with the "sprites default" material.

PS This is the same way I solved text going behind sprites as well just in case that issue arises as well.

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
1

Answer by jpdodson42 · Feb 09, 2018 at 06:53 AM

,Just to add onto this thread in case somebody else comes across it. It seems like there are a number of problems you can encounter when adding a trail renderer to a sprite and not having it display.

Eventually I found out what was going on in my case. I was adding a trail renderer to a sprite that was (obviously) on a canvas. The canvas property "Render Mode" is by default set to "Screen Space - Overlay", but if you want to display a trail renderer, the canvas needs to be able to see it. Having the canvas set to this mode "blocks" it. You can change the canvas "Render Mode" to "Screen Space - Camera" instead, and that should do the trick. Then set the camera property to your main camera.

Adding this in case somebody else has the same issue I was having.

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 ivan1992vuja · Oct 26, 2018 at 08:49 AM 0
Share

This ... dude i was playing around with the line renderer for 2 days couldn't find a way to fix it. thank you !

avatar image
1

Answer by agrav0 · Feb 19, 2019 at 06:15 PM

My trail started to show above sprites when i assigned something to the material (default-diffuse) field in advanced section of the component. But then i found its drawing on everything. Then i changed the material to default particle then the sorting layers started to kick in. and everything was find. the trail renderer seems to just trail the material. so the properties of the material are what i think are causing the problems.

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

TrailRenderer coexisting with sprites 2 Answers

TrailRenderer sorting layer problem. 2 Answers

Sprite Shading 1 Answer

Adding a Sprite 1 Answer

Unity Adds Antialiasing to Texture 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