Godot Version
Question
<!-Hi i wrote this script to animate a pointlight2D, the script is directly on the pointlight. I don’t now what to do to fix this error, ive tried to remplace the path with “self” and with the pointlight name. Im new to codding and would appreciate some solution or explanation for a remplacing line tyyy →
here is the script :
extends Node2D
var time_passed : float = 0.0
var energy_speed : float = 2.0
var color_speed : float = 1.0
onready var point_light = get_node(“player/PointLight2D2”)
func _process(delta):
time_passed += delta
var new_energy = 1.0 + sin(time_passed * energy_speed) * 0.5
point_light.energy = new_energy
var r = abs(sin(time_passed * color_speed))
var g = abs(sin(time_passed * color_speed + PI / 2))
var b = abs(sin(time_passed * color_speed + PI))
point_light.color = Color(r, g, b)