0 votes

I have a "parent" scene called "Enemy" that exports an empty array of strings:

export(Array, String) var idles = []

Then I inherit this scene in some children, such as "EnemyRanged" and "EnemyMelee". When creating my levels, I put some of these two on my map, setting the array elements in the inspector in each of them.

The problem is: The array is always empty, despite adding elements using the inspector.

I've read that in previous versions, the array data was shared between all instances. Is that still a thing on 3.2?


in Engine by (42 points)
edited by

2 Answers

+1 vote
Best answer

Yes, it's still an issue in Godot 3.2.2. However, if you remove "= []" in the declaration it seems to clear it up.

Please see this youtube video where Gonkee describes the same issue. However, several comments say removing "= []" fixes it. I have not tried this myself. Hope it works out!

Gonkee's Export Array Bug in Godot Youtube Video

by (212 points)
selected by

I can confirm that removing "=[]" fixes the issue.

0 votes

try exporting a PoolStringArray instead

by (14 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.