-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
erase_cell() does not erase scene tiles cells #69596
Comments
The tile IS erased, it just doesn't remove the created scene instance (and you can't recreate it, because it's cached). See #67330 |
There is some way to clear that cache or something similar to be able to re-instantiate a scene in the same cell where was freed a previous scene? |
So, is there any possibility in gdscript to remove the actual scene from the tilemap? |
No. You can This issue was discussed on the chat and it was decided that |
I tried doing a dummy operation in the Tileset, but that caused the entire cache to be cleaned and all instantiated scenes to be re-instantiated and duplicated. |
Running into a similiar issue but there seem to be some inconsistencies in general: erase_cell()
#or
clear_layer()
set_cell() my old scenes stay. But when I do: set_cell()
erase_cell()
#or
clear_layer() It won't create any scenes at all (probably because they only get instantiated during the next process or similiar?). I might take a crack at removing the scenes as discussed earlier in this issue. Edit: Whats the right approach here? Say I set_cell() with a Scene and a Node gets created. Then I queue_free() the Node (for whatever reason) without using set_cell/erase_cell to clear it. Should the TileMap periodically do some checkups (to check if the Nodes are still there?). Or should the TileMap actually listen to the Nodes tree_exiting/tree_exited signals? This seems like the most consistent to me IMHO. So when someones moves or removes the Node the TileMap knows and gives up "ownership" of said Node? |
Okay I got a first version running locally. I fixed a crash and so far it seems stable. The only issue right now is that when a new scene is instantiated the Nodes name swaps between Node and @node@ when I set/clear cells repeatedly. I'll try to create a pull request later today. |
I'm running into the same issue right now. Clearing the cache is not really a good workaround for my use case, as my scenes need to remember their state and this resets them completely. I'm sorry to nag, but is this planned for 4.1 ? This seems like a pretty major oversight. |
It is not fully fixed on 4.2. Now the instance is removed when we EraseCell(), but we cant add another tile on the same position. |
@TheKassaK Can't reproduce. Please open a new issue with a minimal reproduction project. |
|
When I use "erase cell" it does not erase any tiles, but I can place tiles and clean the layer |
Godot version
4.0.beta7
System information
Windows 10
Issue description
When using erase_cell() on a cell in which the TileMap set a scene from a scene collection the cell is not erased, and when this tile is moved it is impossible to put another tile in the same cell again.
Steps to reproduce
Minimal reproduction project
Scene Collection issue.zip
The text was updated successfully, but these errors were encountered: