I am trying to do this

``````vec2.Append(
new Vector2(
i * 100,
rng.RandiRange(200, 500)));
``````

And at the output I still get an empty array, the output to the console confirms this

``````(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
``````

Maybe I'm doing something wrong? Explain to me please, here is the whole code.

``````using Godot;
using System;
using System.Linq;

public class Append : Node2D
{
public Vector2[] vec2 = new Vector2;

public RandomNumberGenerator rng = new RandomNumberGenerator();
{
for (int i = 0; i < 10; i++) {
vec2.Append(
new Vector2(
i * 100,
rng.RandiRange(200, 500)));
}

for (int i = 0; i < vec2.GetLength(0); i++) {
GD.Print(vec2[i]);
}
}
}
``````
Godot version 3.3.2-stable-mono
in Engine

Perhaps you need to see if the Vector assignment actually works with plain integers first? (`new Vector2(1,1)`) — And if not then can you `Append` from a variable instead?

Keep back-stepping your code until you find something that works, it will point you to what's actually broken.

Yes, I've already tried Vector assignment with plain integers like `new Vector (1, 1)` and also tried adding from a variable like `public Vector2 x = new Vector (1, 1)`, the result is the same.
At the same time, such a construction works and returns an array filled with random vectors, as I need

``````using Godot;
using System;
using System.Linq;

public class Append : Node2D
{

public Vector2[] vec2 = new Vector2;

public RandomNumberGenerator rng = new RandomNumberGenerator();
{
for (int i = 0; i < 10; i++) {
vec2[i] = new Vector2( i * 100, rng.RandiRange(200, 500));
}

for (int i = 0; i < vec2.GetLength(0); i++) {
GD.Print(vec2[i]);
}
}
}
``````

With this output to the console:

``````(0, 340)
(100, 441)
(300, 419)
(200, 332)
(400, 216)
(500, 258)
(600, 468)
(900, 384)
(700, 207)
(800, 445)
``````