diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-21 11:07:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-21 11:07:43 +0200 |
commit | 307f560b39439042614f206cc28c80dd543b69cf (patch) | |
tree | 9151a11a5119ae257866f0d172a163c9bd8765d5 /scene | |
parent | e9ce59b342528677126596a65ca16d6dc4744e55 (diff) | |
parent | a275b70b6e1cd69646f779605e97b71830025888 (diff) |
Merge pull request #66183 from KoBeWi/ARE_YOU_READY
Set scene tiles' position before adding them
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 42b76d0136..577284a752 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1861,7 +1861,6 @@ void TileMap::_scenes_update_dirty_quadrants(SelfList<TileMapQuadrant>::List &r_ Ref<PackedScene> packed_scene = scenes_collection_source->get_scene_tile_scene(c.alternative_tile); if (packed_scene.is_valid()) { Node *scene = packed_scene->instantiate(); - add_child(scene); Control *scene_as_control = Object::cast_to<Control>(scene); Node2D *scene_as_node2d = Object::cast_to<Node2D>(scene); if (scene_as_control) { @@ -1871,6 +1870,7 @@ void TileMap::_scenes_update_dirty_quadrants(SelfList<TileMapQuadrant>::List &r_ xform.set_origin(map_to_local(E_cell)); scene_as_node2d->set_transform(xform * scene_as_node2d->get_transform()); } + add_child(scene); q.scenes[E_cell] = scene->get_name(); } } |