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
0
Question by AboutRabbit92 · Jun 01, 2015 at 01:15 PM · audiolight

How do I turn off all light (for complete darkness)?

I am using unity for the first time and as a sound designer am not familiar with game engines (anything outside of audio really!).

I'm creating a game which uses audio as a navigation tool, and varies the amount of vision (using spot lights as the main source of light).

How would i turn off the main light completely, and implement spotlights which can be triggered on and off?

thanks

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

1 Reply

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

Answer by KoJix · Jun 01, 2015 at 02:39 PM

You can go to Edit>Render Settings and set the Ambient Light color to Black. This might work for what you're making.

The Spotlights can be triggerd by code. http://docs.unity3d.com/ScriptReference/GameObject.SetActive.html http://docs.unity3d.com/ScriptReference/Light.html

Comment
Add comment · Show 5 · 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 AboutRabbit92 · Jun 01, 2015 at 06:12 PM 0
Share

Great thanks a lot, been stuck on this for too long! New to coding, but i'll give it a go.

avatar image KoJix · Jun 02, 2015 at 05:51 AM 1
Share

Let me know if you need help with it! Cheers.

avatar image AboutRabbit92 · Jun 02, 2015 at 11:07 AM 0
Share

Is coding the only way to trigger spotlights? I have previously used Sphere colliders to trigger audio components, can the same be done with lighting?

Thanks

avatar image KoJix · Jun 02, 2015 at 12:27 PM 1
Share

You can work with trigger colliders yess.

You can do a simple code like:

 using UnityEngine;
 using System.Collections;
 
 public class NewBehaviourScript : $$anonymous$$onoBehaviour {
 
     public GameObject spotlight;
 
     void Start () {
         spotlight.SetActive (false);
     }
 
     void OnTriggerEnter(Collider other){
         if (other.tag.Equals ("Player")) {
             spotlight.SetActive(true);
         }
     }
 
     void OnTriggerExit(Collider other){
         if (other.tag.Equals ("Player")) {
             spotlight.SetActive(false);
         }
     }
 }

But this might be to simple for what you're making

avatar image AboutRabbit92 · Jun 02, 2015 at 11:27 PM 0
Share

great, thanks a lot for your help

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Effect lightsource's output via audio listener? (visualizer style) 0 Answers

Kinect + light control 0 Answers

Activating Audio When Hitting a collider 2 Answers

Avoiding light affection on built-in light shader for projector. 0 Answers

2 audiolisteners in 1 scene 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