It’s working fine for me. And it’s weird it’s not working for you.
Now, if for some reason you’re against a wall, of course it won’t work because even if you add a position, you can’t push through the wall or a floor, and the position will be stuck there.
I tried it on a character in the middle of the screen with no floor, no gravity, no walls, and it works as intended (it would be super weird if Godot didn’t do this basic vector math)
However try this:
print ("------------------------------")
print ("position before: " + var_to_str(position))
position = position + Vector2(1.0, 1.0)
print ("position after: " + var_to_str(position))
Because if I try your code on the _physics_process method, and I start at (0,0) I get this result:
(0, 0)
(1, 1)
(1, 1)
(2, 2)
(2, 2)
(3, 3)
(3, 3)
(4, 4)
(4, 4)
(5, 5)
(5, 5)
which might be confusing and might lead you to think the array doesn’t change, but you’re actually doing two consecutive prints of different physics calls and it’s confusing in your console.
As I said, it works fine for me.
------------------------------
position before: Vector2(0, 0)
position after: Vector2(1, 1)
------------------------------
position before: Vector2(1, 1)
position after: Vector2(2, 2)
------------------------------
position before: Vector2(2, 2)
position after: Vector2(3, 3)
------------------------------
position before: Vector2(3, 3)
position after: Vector2(4, 4)
------------------------------
position before: Vector2(4, 4)
position after: Vector2(5, 5)
------------------------------
position before: Vector2(5, 5)
position after: Vector2(6, 6)