- Home /
Set Light2D sprite via scripting
Hello,
I would like to create an empty object and add to it a Light2D component with a specified Sprite, however, I can't seem to figure out how to change the sprite of the component via script.
Underlined is the property I would like to change via C#
annotation-2020-01-06-120007.jpg
(32.6 kB)
Comment
Answer by fedRasx · Jan 06, 2020 at 10:35 PM
Try this: Light2D.sprite = yourSprite |OR| Light2D.texture = yourSprite
Your answer
Follow this Question
Related Questions
Way to have 2D Sprites lit by Lights? 3 Answers
2D Animation does not start 1 Answer
Is it possible (how?) to hide a light effect with a 2D sprite? 0 Answers
Strange artifacts in builds 0 Answers
Lighting 2d Sprites in 3d environment 0 Answers