dim light as actor moves away

I have a scene that as the characters from a light source I want the range of the light source to shrink to darkness, as he get closer it gets brighter, is this possible?

http://unity3d.com/support/documentation/Components/class-Light.html

the d is not supposed to be capitalised. even on the unity docs the namespace is called "Rigidbody2D."I wasn't really looking in the problem of them not calling the Get Component method correctly because "error: CS0246" refers to "The type or namespace name could not be found (are you missing a using directive or an assembly reference?)."

1 Answer

1

Yes, you compute the distance from the character’s position to the light’s position and adjust the light’s brightness accordingly. http://unity3d.com/support/documentation/ScriptReference/Light-intensity.html