Loop through dictionary using keys

Godot Version



How to iterate over the keys of a dictionary to get the values?

	for obj in get_node("level").get_children():
		obj_list[obj.name] = {
    for item in obj_list:

for key in dict.keys():

What if i need to print the value from specific key?

use if then
then break if found specific key

though, you can just dict[specific_key_value], no?

No…based on the code that i posted , it gives the following error:

“Invalid get index ‘position’ (on base: ‘Dictionary’).”

Got it

    for item in obj_list:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.