0 votes

the title

in Engine by (32 points)

Like, to a file?

2 Answers

0 votes
Best answer

Do you mean a variable exported for editing in the property editor? In this case, like this:

export (String, "Rebecca", "Mary", "Leah") var character_name

(Taken from https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_exports.html , where you will find many similar examples)

by (1,742 points)
selected by

What if I need to select one value from the array of strings?

+2 votes

you can do an enum and export it:

export(MYDROPDOWNLIST ) var myvariablein_inspector

by (184 points)

I was using enums for NPC types and this is an efficient answer for me. Thanks.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.