I'm doing some prototype work for a 2D game. I'm attempting to create and place tiles, derived from Area2D. In the project, I created a MainScene, with a child Node called Tiles, which would managed the tiles. I created one example Tile, which is an Area2D with a ColorRect child. Scripts are attached to the Tiles and Tile objects.
In the Tiles script, I create a new node from the Tile class to make sure the script is attached and set its position to something besides 0.0. In the Tile script, if it has no child node, I create a new ColorRect and set its color.
When I run the project, only the original tile at 0,0 shows. I checked the number of child nodes on Tiles and it is 2.
Am I doing something wrong, or is my methodology just not correct for what I want to do?

using Godot;
using System;
public class Tiles : Node
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Tile t = new Tile();
t.Name = "Tile1";
t.Position = new Vector2(64, 0);
this.AddChild(t);
int n = this.GetChildCount();
Console.WriteLine(n);
}
// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }
}
`using Godot;
using System;
public class Tile : Area2D
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
int n = this.GetChildCount();
if (n < 1)
{
ColorRect c = new ColorRect
{
Color = new Color(0x45ca29)
};
this.AddChild(c);
}
}
// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }
}
`