[Solved] Call a function within an expression

How do I call a function (non object type) within an expression? I couldn’t see a way to do this?

Context: I’m setting an object variable within the ‘Action’ of the event sheet, but wish to use a function i created (non object) which returns a string value.
Both the function return and variable I am trying to set are both String types.

I have spent a good while going through forum posts to try and find the answer, and did have a look through the documentation, including how to build the function which has worked (Return values of functions - GDevelop documentation) but unless i’ve missed it I can’t work this out.

Hope someone can advise.

1 Like

Is your function set up as an expression with a return type of string?

The expression will be under the extension name unless you set the group name which is optional.


Ah! Thank you Keith, an oversight on my part - i didn’t set the function as an expression. Thanks for explanation and also the example for the inclusion of the namespace :: - i also forgot about that. Much appreciated! :slight_smile: