Is it possible to set several variables at once?

Godot Version

4.2.1

Question

In python, it’s possible to set multiple variables at once like so:

func my_function():
return 2, 3

a, b = my_function()

And I was wondering if something similar would be possible in Godot, or if I have to recieve an array or dictionary and set every single variable I wanna change?

What I want to do is feed certain variables into a function and have them be modified by the function

Unfortunately it’s not possible to do this. You will have to do the array / dictionary method.

1 Like