Use Function to return

I need to create a function that receives a numeric parameter. Check if it matches with a Global variable and return a value of 0 for not matching, 1 for matching.

I need to use the return value to write a string: “matches” or “Does not match”.

But never use a Function in Gdevelop. I tested some things without results.

can anybody help me?

You have 3 differents type for return an value in an function.
You will find these in actions.

image

And where does this value go?
I don’t think I know how to call a function

  1. Create a custom expression/function in the behaviour window.

  2. Set it as a condition

  3. Set up your conditions with their return value

  4. In your events sheet you can now use the condition

1 Like