attempt to call 'get_value' in base 'null instance' on a null instance

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pafos_kota

I have some problems with controlling music in the game options and can’t find way out. it works normal until player click the button ‘+’ or ‘-’
Maybe i do something wrong?

 extends Button
func _pressed():
	var node = get_node("Control/music/Slider")
	
	if(name == "minus"):
		node.set_value(node.get_value() - node.step)
	else: 
		node.set_value(node.get_value() + node.step)
		
	var dbVolue = node.value
	AudioServer.set_bus_volume_db(AudioServer.get_bus_index(get_node("Control/music").name), dbVolue)
	get_node("Control/SFX/AudioStreamPlayer").play()
:bust_in_silhouette: Reply From: kidscancode

That is telling you that node is a "null instance. That means that get_node("Control/music/Slider") is not a returning a valid node, probably because the node path is incorrect.

You need to use the correct path from this Button node to the “Slider” node. I can’t tell you what that is because I can’t see your scene tree.

See here for an explanation of node paths: http://godotrecipes.com/basics/getting_nodes/