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
1
Question by oktemre · Feb 12, 2014 at 09:30 PM · 2dlinerendererunity 4.3

LineRenderer is not visible

I'm developing a 2D game by using Unity 4.3 and using Line Renderer. I'm setting start and end points and see the line on the screen without a problem.

However, after adding a big sprite as a background on my screen, the line is not visible anymore. I see it when I remove the background from my screen.

Following ones didn't work for me?:

 rope.sortingOrder = 10;
 rope.GetComponent(SpriteRenderer).sortingLayerName = "GameArea";

Any suggestion will be appreciated.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
11
Best Answer Wiki

Answer by oktemre · Feb 22, 2014 at 12:29 AM

Solved by changing z position of background from 0 to 10. I hope this helps someone.

Comment
Add comment · Show 4 · 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 holczhauser · Dec 14, 2015 at 10:40 PM 0
Share

Saved my night, after 2 days of pain :) Thanks you very much

avatar image Francheesecake · Dec 16, 2016 at 01:31 AM 0
Share

You just saved my life!

avatar image FreshTofu · Apr 26, 2018 at 12:44 AM 0
Share

Yes changing the z position solved the problem for me thanks very much :). I wonder this is the case??

avatar image chs7829 · Jan 18, 2019 at 05:23 AM 0
Share

thank you!!!!

avatar image
19

Answer by Prosto_Lyubo · Aug 16, 2014 at 05:35 PM

sortingLayerName + sortingOrder, if You work in 2D environment will work correctly only if You will assign Material with Sprites shader. In Your assets create new material, then in Inspector under Shader list pick: Sprites->Diffuse. Drag&Drop created material to Materials slot of LineRenderer.

Comment
Add comment · Show 4 · 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 3ddave · Jan 02, 2016 at 11:12 PM 0
Share

Very useful information here that I did not see elsewhere. In my case I had a standard shader attached to my line material which worked in most cases. I could not figure out why the lines did not correctly render when under a Canvas though. Switching to a sprite shader fixed the issue! Thanks!

avatar image Ridhuan-Naim · Feb 15, 2016 at 03:32 AM 1
Share

Thanks, by changing Sprites>Diffuse fixed that, Its not visible before caused by using standard shader material which disappear on certain camera angles

avatar image pierre531 · May 14, 2017 at 04:58 PM 0
Share

Thanks! it solved. I guess it's something internal Unity shader code.

avatar image Frostoise · Nov 10, 2020 at 10:48 PM 0
Share

This should be the accepted answer. Sorting layers are always better than changing the z value of elements in 2d.

It's really weird how Line Renderer doesn't have the Default - Line material automatically. I wonder if it's a bug.

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

26 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

Related Questions

Unity 4.3 Physics 2d Change Axis 1 Answer

Unity 4.3 Any chance Sprite mesh will become accessible in futur update ? 1 Answer

2D Animation does not start 1 Answer

LineRenderer just showing awful results 3 Answers

What's the best way to draw a 2D line WITHOUT using LineRenderer? 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