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
3
Question by kreed · Dec 13, 2011 at 08:39 AM · c#2dlightingspriteplatformer

Way to have 2D Sprites lit by Lights?

Is there any way to have lights actually apply lighting to 2D textures, without losing the transparency of the sprite? I have been using the Particles/AlphaBlended Shader to display my sprites.

I would like to have a dark room, and allow the player to use a light to make his way through, but I can't seem to make lights work.

If there isn't a way to make the stock lights work, then does anyone have another suggestion? I have heard of many ways to achieve similar effects, but I am not sure of the best approach considering Unity is built different than Engines I am used to.

Thanks -Kreed

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

3 Replies

· Add your reply
  • Sort: 
avatar image
21

Answer by zee_ola05 · Feb 23, 2014 at 08:34 PM

Create a material and use Sprite/Diffuse shader. Drag it to your sprite gameObject to apply the material. Voila!

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 Andrii · Jan 05, 2017 at 11:46 PM 0
Share

NIce! Exactly what I was searching for!

avatar image Siliko · Sep 27, 2020 at 07:49 PM 0
Share

Thanks :**

avatar image
3

Answer by Noob_Vulcan · Jul 30, 2015 at 03:34 AM

Sprites-default material does not respond to lights , but unity also supports another shader (Diffuse ) for sprites that supports lighting.

You just have to change the shader in Sprite renderer component

For more detail you can refer LINK REMOVED DUE TO MALWARE

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 glenneroo · Jul 08, 2018 at 12:05 AM 1
Share

That link won't let me open it until I install a Firefox Plugin, which I am definitely NOT going to do. Do you have a link which is less sketchy?

avatar image glenneroo · Aug 05, 2018 at 04:11 PM 0
Share

Now your link returns an empty page.

avatar image nicmarxp · Feb 06, 2019 at 07:08 PM 2
Share

BEWARE: The link leads to malware, mods, please remove it.

avatar image OlafsOsh nicmarxp · Apr 26, 2020 at 04:14 PM 0
Share

YES! BEWARE! If clicked, do yourself a favor and run $$anonymous$$alwareBites.

avatar image
0

Answer by Eric5h5 · Dec 13, 2011 at 09:04 AM

On the particle renderer material, use a shader that uses lighting.

Comment
Add comment · Show 8 · 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 kreed · Dec 13, 2011 at 02:42 PM 0
Share

I am confused by your comment. What do you mean by the "particle renderer material"?

avatar image Eric5h5 · Dec 13, 2011 at 02:46 PM 0
Share

The material used for the particle renderer.

avatar image kreed · Dec 13, 2011 at 02:46 PM 0
Share

Oh, I believe you misunderstood the question. I am using a texture on a plane for my character's sprite. I want to light him, not a particle system.

avatar image Eric5h5 · Dec 13, 2011 at 02:56 PM 0
Share

Well, same answer basically...on the sprite renderer's material, use a shader that uses lighting.

avatar image Eric5h5 · Dec 13, 2011 at 03:17 PM 1
Share

Use a shader that has transparency and lighting.

Show more comments

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

11 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

Related Questions

Lighting looks really weird in 2D game 1 Answer

Set Light2D sprite via scripting 1 Answer

2D Flashlight for a platformer 2 Answers

How to Change to the Same Point in Another Animation 0 Answers

Strange artifacts in builds 0 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