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 cappie013 · Sep 27, 2013 at 04:55 PM · lightinglightmapmusic

How to make a lot of light blinking ?

For my first game, I try to make my game reacting to a specific music. To do this, I want to create a lot of light and make them blinkings. I try to create two differents lightmap and switch between them, but this doesn't seem to work.

Any lead to help me ?

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
0

Answer by tanoshimi · Sep 27, 2013 at 05:12 PM

You can set the intensity of each light (and other properties - their colour, range etc.) programmatically through script. For example, attach the following C# script to a light object to make it pulse every second (or whatever value you set "duration" to be):

 using UnityEngine;
 using System.Collections;
 
     public class BlinkingLight : MonoBehaviour {
         
         public float duration = 1.0F;
         
         // Update is called once per frame
         void Update () {
               float phi = Time.time / duration * 2 * Mathf.PI;
               float amplitude = Mathf.Cos(phi) * 0.5F + 0.5F;
               light.intensity = amplitude;
         }
     }

To sync this to music instead, you might want to make use of this code.

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
avatar image
0

Answer by cappie013 · Sep 27, 2013 at 06:04 PM

The number of lights who can be rendered is limited, isn't it ? So, if I'll have 20 on my screen, your code won't work. I want to reproduce the effect in this game : http://hellorun.helloenjoy.com/

Comment
Add comment · Show 1 · 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 tanoshimi · Sep 27, 2013 at 06:50 PM 0
Share

(I think what you've just wrote was meant to be a comment, not an answer. And, for future reference, it's helpful when you're trying to copy the effect of something else if you write that in your original question... ;)

I see nothing in that demo that receives variable lighting or casts dynamic shadows. All I see is some textures that have emissive properties and a glow post-process effect. So I don't think you mean "lights" at all. You just want a surface shader that exposes the emissive property of a material that you can control from script, using a ti$$anonymous$$g loop similar to that I posted above.

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

16 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

Related Questions

How to properly light interiors 0 Answers

lightmapping 1 model in different scenes 1 Answer

Why realtime and lightmapping results so different? 1 Answer

Unity 5 lightmapping issue. 0 Answers

Lightmapping Darkness & Lightmapped Hard/Soft Shadows 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