Pointlight2D script codding help

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 :slight_smile: 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)

I believe it should be
@onready
instead of just
onready

i tried it and it kinda work ty. but it does nothing i tried to put different value in the var time-passed and the others but still nothing