null and Object#null are not the same...?

Godot Version: 4.4.1 stable

I need to compare two arrays, one of which gets its data from button icons, the other as from variables. this always works, except if a button icon is empty. The array takes the empty icon as <Object#null> and the variable as <#null>. (without the # but else it wont show as text)

Example:

(The first array is the one that gets its data from button icons, the second from variables)

How can I make the first values of the two arrays return the same?

1 Like

Arrays have a .sort() function, but if im not mistaken that sorts integers and whole number floats. I don’t know how your building these arrays, but you may consider an if statement in there to check for a null variable and set it to a string called “null”, or perhaps you just need a defualt blank texture to set things to so you know you’ll always have a texture, but that that texture is “empty”(doesn’t display anything).

A dictionary may be more useful, i find them easier to parse as a human, but that may not be viable for your setup.

1 Like

Thank you so much!

The solution with the empty texture works way nicer than I expected, I was afraid of a lot more extra code.

1 Like