Invalid assignment of property or key ‘data’ with value of type ‘Array’ on a base object of type ‘Sprite2D (Ability)’.
class_name Ability
extends Sprite2D
@export var data: Array[Array]
Thats the ability in question ^
new_ability.data = [[2, 2], [2, 3], [2, 4]]
And thats the script that instantiates it and tries to set the nested array’s data. Returns the error message above. Can’t set data, a nested array, as a nested array? Sorry if this is super obvious but i’m mystified
data: Array returns the same error, for some reason
I tried typing it, but godot says it doesnt support typed nested arrays. Im on 4.5.1 stable
”Nested type collections are not supported,” specifically
There might be something more insidious happening here, because I stopped getting an error message at all, it just tells me the breakpoint. And I tried
I can, and I think i’ll have to. Didn’t wanna do that cause I’m a couple resources deep already but I suppose it’s the same either way. Thank you all for the help!
Like the error says “breakpoint”? If so click the red dot beside this line in the script editor, a breakpoint intentionally stops the game so you can debug a non-failing function.
wth. now it does work (var new_data → ability.data)
i tried recreating it to see the breakpoint
Idk if I trust that. Sorry I cant get the info for you, godot doesnt want to give it anymore
breakpoints can be added by clicking the “line gutter” in godot’s script editor, it’s not uncommon to accidentally make a breakpoint. If “breakpoint” appeared as your error it was probably a misclick, not a scripting issue.
Typed arrays are still a little funky too though; mostly when assigning [...] evaluates to Array rather than a more specific type, for some reason initializing a new variable will try harder to correct the type, and as is the keyword to specify types.