1
\$\begingroup\$

I want a function that can return something, or not, in gdscript

func test() -> String | null:
  return null if random() > 0.5 else "hi"

The syntax above is not real. How do I make a return type of String or null?

\$\endgroup\$
1

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.