In my project, when I load a level dynamically, the level has a tilesource associated with it in the *.lua file.
I use this string to load the static tilemap (level map in my collection as a placeholder) with a source file resource that has collision data set from within the editor. What I assumed would happen with the tilesource swap is the collision hull data would swap with it, but instead it retains the default tile’s collision mapping data and uses it when I use tilemap_settile()
. The tile displayed is correct and from the newly swapped tilesource, but the collision hull info is still from the default tilesource which causes tiles that should not have physical attributes to have collision shapes.
What can be happening here?
Tiles swapped in before tile setting like so…
local source = loader.getTileSource(mapFile)
local source_id = go.get("/resources#script", source)
if source and source ~= "" and source_id then
go.set(mapUrl, "tile_source", source_id )
go.set("/overlay#game_level", "tile_source", source_id )
end