Can someone show me how to make a flashlight effect in unity... just simply take an object like cylinder and attach a spotlight to it... I think it would be a great simple tutorial for all the newbies here!
I tried to juyst make a cylinder and attatch a spot light to itm, but it failed. I hope someone helps me too.
If all you need is to make the area you are lighting brighter then the rest of the scene (Without actually seeing the beam) then all you need is a game object with a spot light attached to it. Of course, if you want that distinctive circular shape that is created - you need to have your scene use diffuse shading, and have your flashlight forced to be a pixel light. Plus - have the light cast shadows (if you have Unity Pro) to see the full effect in action. About the shaders - it's pretty straight forward. Select the objects your scene is made of, and make sure that in their materials, the shader that is selected is Diffuse and not Vertex-Lit. About the light (obviously make sure it's of type spot and not directional or pixel) - select your light, and in the inspector make sure that under "Render Mode" you have "Force Pixel" selected. If you want - add a cookie texture to make those artifacts that you see when you use a real life flashlight. The ones that make ring-like features on the objects you are pointing the light on... If you want to actually see the beam - like when your room is dusty, and the light is visible, then you'll need a little more work. A mesh for the cone that will be semi-transparent, and maby some shader/particles work if you want that "dusty" effect. If you're having troubles, just post and i'll try and help out... No time for a full tutorial thought... :/
You could also just attach a spot light to an object and narrow the spot angle to something like 5 degrees. I think you'll want to make sure that the surfaces (like terrain) use pixel lighting in that case, or else it'll light up a lot more than you want. You get something like this: EDIT: Whoops, misread the previous post. He did in fact suggest a spot light exactly like this.