Topic was automatically imported from the old Question2Answer platform.
Asked By
vonflyhighace2
Old Version
Published before Godot 3 was released.
Can someone give me an example of how you would call a function from a dictionary in Godot I’ve asked this question before but I just can’t get it to work. An example would be ideal. Thanks
Thanks a lot. This was driving me batty trying to figure this out in GDScript. man, life saver.
vonflyhighace2 | 2016-04-03 01:21
On the last line of the “full example”, what is call_func? Where did that come from?
ogrotten | 2017-07-25 18:00
funcref(self, "test_func") creates a FuncRef object.
The FuncRef class has the method call_func, which simply calls the referenced function with the given arguments and returns its return value.