I apologize for my wording of the question, as I do not know how best to ask it. I'm having a difficult time understanding maybe how arrays work in general.
I have a timer that when timeout will append to an array the Vector2 position of each image that I have. if the images start in position (0, 0) the following code snippet prints that the array contains a Vector2(0, 0).
func _on_ImagePlacedTimer_timeout():
for area_node in part_instance_array:
var node = area_node.get_node("Part")
node_position.append(node.position)
print(node_position.has(Vector2.ZERO))
node_position.clear()
If I do not change the position of the image and it remains at (0, 0) the above timer will continue to print True even though I clear the array after every timeout. If I however move the image away and back to the position (0, 0) the above code will then report that it does not contain a Vector2(0, 0).
With the follow code snippet I get back "True", which is my desired result, after moving the image away from and back to position (0, 0).
func _on_ImagePlacedTimer_timeout():
for area_node in part_instance_array:
var node = area_node.get_node("Part")
node_position.append(Vector2(int(node.position.x), int(node.position.y)))
print(node_position.has(Vector2.ZERO))
node_position.clear()
I'm confused as to why the first code snippet would continue to print "True" until after I moved the images positions?