Skip to content
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

Cannot delete tilemap scene collection tiles with set_cell #91119

Closed
devantti opened this issue Apr 24, 2024 · 3 comments
Closed

Cannot delete tilemap scene collection tiles with set_cell #91119

devantti opened this issue Apr 24, 2024 · 3 comments
Milestone

Comments

@devantti
Copy link

Tested versions

  • Reproduciple in: 4.1.x (tested at least in 4.1.3 and 4.1.4)
  • Not reproducible in: 4.2.1, 4.2.2

System information

Godot v4.2.2.stable - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M3 Pro - Apple M3 Pro (12 Threads)

Issue description

TileMaps set_cell function does not delete tiles that use scenes collection as described in documentation:

If source_id is set to -1, atlas_coords to Vector2i(-1, -1) or alternative_tile to -1, the cell will be erased. An erased cell gets all its identifiers automatically set to their respective invalid values, namely -1, Vector2i(-1, -1) and -1.

Steps to reproduce

  • Add scene to tileset scene collection.
  • Use code to add as tile to tilemap
  • Try to erase cell with set_cell:

tile_map.set_cell(0, position)
tile_map.set_cell(0, position, -1, Vector2(-1, -1), -1)
tile_map.set_cell(0, position, -1, Vector2(-1, -1), 0)
tile_map.set_cell(0, position, -1, Vector2(0, 0), -1)
tile_map.set_cell(0, position, -1, Vector2(0, 0), 0)
tile_map.set_cell(0, position, 0, Vector2(-1, -1), -1)
tile_map.set_cell(0, position, 0, Vector2(-1, -1), 0)
tile_map.set_cell(0, position, 0, Vector2(0, 0), -1)

In MRP use left mouse button to add tiles and right mouse button to delete.

Minimal reproduction project (MRP)

scene_collection_mrp.zip

@AThousandShips
Copy link
Member

Since this has been fixed in 4.2 and 4.1 is possibly not going to receive any more fixes, the solution is to upgrade to 4.2

@devantti
Copy link
Author

Ok. I'm kind of stuck between this and problems with touch on 4.2.x: #88621. :/

@AThousandShips
Copy link
Member

A fix for 4.1.x is unlikely to happen sooner than a fix to that bug I'd say, if any fix is cherry picked for 4.1 at all, hard to tell without knowing what fixed the issue in the first place

@devantti devantti closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants