+1 vote

I'm trying to export an autoloaded enum within a GDScript as follows:

export(Singleton.ENUM) var options

I receive the following error:

Expected constant expression

I'm not exactly sure what to make of this error message as I was under the impression enums were constant. Besides the following runs without errors:

  export(ENUM) var options

The only reason I could see this being the case is because the context which it is being used isn't static. If this is the case how may I create a local copy of ENUM so
as I can export it to the scene. My attempt results in the same error:

const enum= Singleton.ENUM
export(enum) var options

Any help would be appreciated!

in Engine by (28 points)

2 Answers

+1 vote
by (28 points)
0 votes

Have anyone found a workaround for this? I'm stuck with the same

by (23 points)
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.