The for loop i
is a copy of each element in the array, the same way this doesn't change P1
:
var P1 = 5
var P2 = P1
P2 = 0
print(P1) # 5
If you want to change an array element, you need to loop using a index:
for i in Points.size():
Points[i] = 0
print(Points[0]) # zero