I want to set the script for a node via code. I have assumed that set_script() is doing this but it does not work in my case.
const script = preload("res://path_to_script.gd")
func call_script():
get_node(path_to_node_to_which_script_shall_be_attached).set_script(script)
Do I miss something? Do I have to "start/load" the script after I have attached it to the node?