0 votes

I want to make a fading light on my script, how do i set the light energy with script?

asked Jan 10, 2017 in Engine by flonkopaten (29 points)

2 Answers

0 votes

I found out myself, this is how i did it.

    var mylight = get_node("../DirectionalLight")
    var energy = mylight.get_parameter(3)
    energy -=0.03
    mylight.set_parameter(3, energy)
answered Jan 10, 2017 by flonkopaten (29 points)
0 votes

It does not have a setter, it seems so you will have use set_parameter( int variable, float value ) with PARAM_ENERGY as first parameter.

Everything is in http://docs.godotengine.org/en/stable/classes/class_light.html (just lacks of details...)

answered Jan 10, 2017 by eons (6,106 points)
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.