I recommend you read this post and then give us enough information to help you.
Search for the answer
Before asking a question, check Godot Docs and use the Forum Search functionality to make sure your question hasn’t been answered or there isn’t an ongoing discussion on that topic already.
If you don’t know where to start, try here: Getting started , Your first 2D game , Your first 3D game .
Create a good post
Click on each point to expand.
1. Write a good topic title
2. Use the template
3. Format your code
Describe your problem
Explain the problem you’re having in deta…
Resizing an Array is not something you typically do in GDScript. So the fact that you are doing it raises red flags. If you’re trying to make a game, tell us what you’re actually trying to accomplish with this solution.
If you want to know how the internals of how the engine works, take a look at the source code:
Vector<Variant> validated_array = p_array._p->array;
Variant *write = validated_array.ptrw();
for (int i = 0; i < validated_array.size(); ++i) {
ERR_FAIL_COND(!_p->typed.validate(write[i], "append_array"));
}
_p->array.append_array(validated_array);
}
Error Array::resize(int p_new_size) {
ERR_FAIL_COND_V_MSG(_p->read_only, ERR_LOCKED, "Array is in read-only state.");
Variant::Type &variant_type = _p->typed.type;
int old_size = _p->array.size();
Error err = _p->array.resize_initialized(p_new_size);
if (!err && variant_type != Variant::NIL && variant_type != Variant::OBJECT) {
Variant *write = _p->array.ptrw();
for (int i = old_size; i < p_new_size; i++) {
VariantInternal::initialize(&write[i], variant_type);
}
}
And if you feel there is a bug, log it here: Issues · godotengine/godot · GitHub