0 votes
in Engine by (178 points)

1 Answer

+1 vote

Read the docs: The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of Light.

So you need to call function from Light class set_parameter( int variable, float value ). Variable is constant PARAM_ENERGY = 3. Value is the value of energy.

by (820 points)

Thanks a lot. My code after read documentation was and your comments:

var main_lamp = get_node("/root/main/OmniLight")

var energy = main_lamp.get_parameter(3)
energy += 0.5

main_lamp.set_parameter(3, energy)

That looks fine. You can even write main_lamp.set_parameter(main_lamp.PARAM_ENERGY, energy).

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.