Autocomplete for types fails when using pick_random() on an array #12895
Replies: 4 comments 7 replies
-
Someone more well-versed in the GDScript engine may be able to provide more accurate insight than I can. But to my understanding, this limitation is due to some relatively fundamental parts of how GDScript/Godot is built. It'd require support for generics, which in turn would require rearchitecting a surprising amount of the GDScript engine. I think generics might be planned for an eventual GDScript rewrite/refactor soonish, but I'm not certain. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This is already tracked in: |
Beta Was this translation helpful? Give feedback.
-
Closing, as this was fixed by godotengine/godot#92584 (and is actually a bug, rather than a missing feature; see #7364). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I have an Array[PackedScene], and I use pick_random() on it, the variable that I get sent back does not autocomplete any PackedScene functions, such as instantiate(). I assume this is because pick_random() is coded to return a Variant, but I believe that this should be returning whatever the type in the Array is.
pick_random()

showing what the autocomplete normally looks like

Beta Was this translation helpful? Give feedback.
All reactions