Godot Version
Version 4.2
Question
I am procedurally generating a scene using noise and other factors. I am instantiating a tree scene like this:
@onready var Dtree = load(“res://World/DTree.tscn”)
for x in range(width)
for y in range(height)
if (code for if there is a tree in that spot)
get_parent().add_child.call_deferred(dtree)
dtree.position = (Vector2( x, y ))
dtree.y_sort_enabled = true
When I do this (for any object I add this way), it seems to just break the ysorting. My tree scene already has ysorting enabled, as does my procedurally generated scene node. The player too. This is only a problem when the object is instantiated, not when it is already a child of the scene. I’ve attached a picture of what it looks like when an object is instantiated (in this case it’s a bush), and when I just put the object in the scene.
If anyone has any ideas of what might be causing this issue, it would be greatly appreciated.
I can follow up with more information if necessary.