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
0
Question by willaay96 · Jul 12, 2016 at 12:16 PM · c#lightingunity 2dinstantiate prefabshooter

Instantiated objects, not reacting to lighting

Hi, I'm building a Horror game and have spotlight coming from the weapon, for testing, I already have a prefab of the enemy alive at start which reacts to lighting all fine, however, when the other enemies are instantiated they do not react to the lighting the same way the enemy already alive does. How do I make the lighting so that these instantiated objects are affected by light in the same way?![alt text][1]

My current light settings: [1]: /storage/temp/73888-screenshot3.png

screenshot3.png (30.8 kB)
Comment
Add comment · Show 6
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 vlucki · Jul 12, 2016 at 04:31 PM 0
Share

I remember reading something about lighting not working correctly sometimes in the editor (and have actually experienced this quite a few times).

Do you experience the same problem when building the game and running it?

avatar image willaay96 · Jul 12, 2016 at 07:59 PM 0
Share

I just tested this in a new build, and it's exactly the same, where only the prefabs in game on start work with it, and the instantiated don't, however looking into this, my bullet prefabs look like they have lighting, even though they're also instantiated. Very Strange.

avatar image tanoshimi · Jul 12, 2016 at 08:22 PM 0
Share

We don't have enough information: what rendering path are you using? Is this the only light in the scene? How many pixel lights are allowed in your quality settings? What shader is assigned to the material on the objects being instantiated?

avatar image willaay96 · Jul 13, 2016 at 06:16 AM 0
Share

Ok, Render path is forward, there is two lights in the scene; one spotlight, one point light, but both with same settings. I'm not sure about the pixel lights. And the material is : Sprites/diffuse. However as I said earlier, I have a prefab already in there at start and lighting works on it, but not the instantiated versions of it.

avatar image vlucki willaay96 · Jul 13, 2016 at 08:14 AM 0
Share

The lights don't work even if you position the instantiated prefabs at the exact same spot as the one that was already in the scene?

avatar image willaay96 vlucki · Jul 13, 2016 at 03:53 PM 0
Share

Yep, still nothing, ill attach a picture to show the difference, sorry if it's kind of dark.alt text

Basically, in the picture the two enemies closest to the player, are the instantiated versions, and the one at the back is the version in game at start. The lighting hits the start up version, but somehow ignores in some sense the instantiated ones.

screenshot4.png (110.4 kB)

1 Reply

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

Answer by willaay96 · Jul 15, 2016 at 03:01 PM

I think I've found the issue, the instantiated objects Z position is getting set to -1.9 when they spawn.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Instantiate random platforms 0 Answers

Is it better to use ParticleSystems on one GameObject OR instantiate ParticleSystems? 1 Answer

Argument Exception: The Object you want to instantiate is null (A new one?) 2 Answers

Spawn multiple enemies in relation to gameobject [SOLVED] 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