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 ZioFede87 · Nov 08, 2011 at 07:04 PM · lightselectionspotlight

How to make an always visible spotlight?

Hi!

I have a problem with my game: I'm trying to use a spotlight on top of my unit that will send a light circle on the terrain when I select the unit, the problem is that when the unit go away from the camera the light disappears. Is there a way to make a spotlight always visible, also at great distance?

Thanks!

P.S. I add a link to my work so you can evaluate the problem (hope that this doesn't brake any rules..)

http://federicolaggiard.altervista.org/forumExample/WebPlayer.html

you can click on the unit an then on a far point on the terrain, the result was that when the soldier go too far the red circle upon it will disappear.

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 DaveA · Nov 08, 2011 at 07:27 PM 0
Share

What do you mean by 'unit' ?

avatar image ZioFede87 · Nov 08, 2011 at 08:22 PM 0
Share

With "unit" I mean the mesh that I use to represent a soldier...maybe a link to see my work can help?

3 Replies

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

Answer by ZioFede87 · Nov 11, 2011 at 11:43 AM

I've solved this issue using a plane with a texture applied on it.

I've tried with a decal projector, as suggested by Fabkins, but this doesn't solve the problem of the disappearing light on long distance. So a simple mesh do the work for me.

Thanks all for your replies.

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 Rookhaven · Nov 08, 2011 at 08:33 PM

If you want your unit to always be lighted, you could make the light a child of the unit and it will move with him (rotation and all).

Another option is if you don't want your spotlight to move, but always be visible, you don't really need the light unless you want the ground lighted. You would need a texture with an alpha gradient that looks like light shining in the appropriate direction (sprite). Then attach the texture to a material with a transparent shader to see through it. If you want the gound lighted, parent the light to the sprite or vice versa. Make sure the sprite doesn't cast or receive shadows though.

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 ZioFede87 · Nov 08, 2011 at 09:08 PM 0
Share

Thanks for the answer!

I've used the spotlight because it make more simple (for me) to project the circle on a rising surface (ex. a hill), probably that's not the correct way, maybe you can point me on a tutorial that explains how to use a sprite in that way?

I've added a link to my demo so you can see the problem

avatar image
0

Answer by Fabkins · Nov 08, 2011 at 08:36 PM

You could make the light Render Mode: "Important" in the inspector for the light.

Also is the light attached to your "unit"?

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 ZioFede87 · Nov 08, 2011 at 09:10 PM 0
Share

Thanks for the answer!

I've try to make the light "important" but that not solve the problem. Yes the light is attached to the "unit" (it is wrong call it that way?? sorry for my bad English..) so they will move togheter.

avatar image Fabkins · Nov 08, 2011 at 09:31 PM 0
Share

Ok. I would create a light. Attach it to the player (make sure position slightly above him, like 0,2,0):

  • Type: "Point Light"

  • Range: 10

  • Color: White

  • Intensity: 1

  • Shadow type: no shadows

  • Render mode: important

  • Culling $$anonymous$$ask: Everything

  • Lightmapping: Realtime Only

If that doesnt give you a light I'm puzzled.

Also stick an object near by to see if that lights up although I cant think of what you could have done to the terrain.

avatar image ZioFede87 · Nov 08, 2011 at 10:20 PM 0
Share

Sorry, but I don't understand. Did you have see the demo in the link up there? I already have a light with the following characteristic:

  • Type: Spot

  • Range: 10

  • Spot angle: 20

  • Color: red

  • Intensity: 8

  • Cookie: (I've created a personalized cookie)

  • Shadow Type: no Shadow

  • Draw Halo: no

  • Flare: none

  • Render mode: important

  • Culling mask: terrain

  • Lightmapping: auto

I've also attached a script that allows me to activate/deactivate the light and make it rotate

Still the light disappear when the soldier go too far from the camera.

Thanks again for ur help

avatar image Fabkins · Nov 08, 2011 at 11:38 PM 0
Share

Ah , I couldnt figure out how to move your player and didnt see the light at all. Now I see what you are doing.

Looks like you got issues with the far clip plane as a guess.

For what you are trying to do a light isnt the right thing as ZioFede said. Use a decal or maybe even a projector.

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

Low shadow quality from distance light 2 Answers

iPhone: what's the best way to create disco-type spotlights? 0 Answers

Light Cookie problem 1 Answer

Light and lag problem 0 Answers

Poor spotlight gradient in Unity 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