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 robcbryant · Mar 15, 2014 at 09:53 PM · lightinginstantiate prefablighting bug

When intanstiating an object--it is unaffected by lighting and remains dark. Only ambient lighting works.

Hey all!

So my problem deals with instantiating objects into a scene. If I have the ambient light turned on, all instantiated objects are lit when instantiated. I don't want to use ambient lighting however.

I'm doing a 2d game and using a directional light to emulate the ambient light--but setting it to specific layers so each background layer can be lit darker than the foreground.

So I'm instantiating bullets that are set to their own layer with a directional light that is set to the same layer yet they aren't lit by the light. If I set another object that isn't instantiated to that same layer--it is lit by the light when the game starts rendering.

The only solution I've found--which doesn't work actually--is instantiating a light with the instantiated bullet--it works sometimes--and half the time the bullets still aren't lit or turn off halfway through their lifetime.

So is this a bug in Unity?

Comment
Add comment · Show 2
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 robcbryant · Mar 16, 2014 at 09:02 PM 0
Share

The only answer I've figured out is to instantiate all the needed bullets with the scene and rotate them out of an array rather than instantiate/destroy. This is all good and well and I need to do this anyway for performance reasons--but this is still a problem--especially when I'm going to start instantiating levels procedurally. Has no one experienced this issue before?

avatar image robcbryant · Mar 17, 2014 at 07:05 AM 0
Share

Update: I tried upping the # of pixel lights in the quality settings--living on a prayer--it also did not work.

1 Reply

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

Answer by robcbryant · Mar 17, 2014 at 07:25 AM

Finally!! 2 weeks of dealing with this and I figured it out.

The directional light set to the culling layer that should always be lit(The layer with instantiated bullet objects) needed the "Render Mode" changed from "auto" to "Not Important". I'm not sure why this is the case--but it works regardless. If someone wants to explain this to me please do!! I hope this helps anyone else with this problem.

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

20 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

Related Questions

Lightmap details 0 Answers

How do I fix my lightmap problem? 2 Answers

is there any advanced lighting tutorial 0 Answers

Baking lights increases scene brightness. 1 Answer

I did something and now my scene looks weird 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