godotengine / godotengine/godot

Exported packed arrays constructed from arrays are null in the inspector

Open
#106,965 3 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:editor topic:gdscript
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.5 dev4

### System information

W10

### Issue description

If you export a packed array property like this:
```GDScript
@export var weights := PackedFloat32Array([5.25, 4.25, 3, 2, 1.5])
```
It's null in the inspector

![Image](https://github.com/user-attachments/assets/0a77973c-640c-4ef1-bc22-3bf76463222c)

When you click it, there are no elements and you can revert it back to null.

This works correctly:
```GDScript
@export var weights: PackedFloat32Array = [5.25, 4.25, 3, 2, 1.5]
```

### Steps to reproduce

See above.

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.