I'm facing a strange problem, I have a script that adds the ground blocks using two nested for loops as the scene starts
var tile = {
"grass" : load("res://scenes/ground/grass.tscn"),
"rock" : load("res://scenes/ground/rock.tscn"),
"sand" : load("res://scenes/ground/sand.tscn"),
"swamp" : load("res://scenes/ground/swamp.tscn"),
"water" : load("res://scenes/ground/water.tscn")
}
func _ready():
ground = get_node("Ground") as Node
for x in range (-3, 3):
for z in range (-3, 3):
var newTile := tile["grass"].instance() as Spatial
ground.add_child(newTile)
newTile.transform.origin = Vector3(x, 0, z)
inside this scene, there is also a character positioned just above the ground level, as the scene starts it falls on the ground and I have the result shown in this gif

If I build the ground manually inside the scene instead to create it using those loops, the character falls on the ground and stands still as it should.
What do you think? Why do I have this problem?