My first attempt to implement objects involved a tilemap, adding single-tile objects. The primary issue I have encountered relates to how those objects are y-sorted with the player:
Background: I have a player whose collision box occupies one tile, but whose sprite is larger than that single tile. I also have a tree sprite which occupies a 2 wide by 3 high tile area and has a two tile wide collision box at its base. The player should be able to move behind the tree and appear behind it, and appear in front when in front of it.
The issue: When the player is standing below the top row of tiles of the tree object (which I have presently created and added to the game using a tilemap, single tile object), it is displayed in front of the tree when it should be behind it.
The player in the middle two tiles of the tree: https://imgur.com/a/1iSjnTN
When the player is in the top two tiles of the tree or in front of the tree, it displays correctly. At present, I believe that this is caused by the tilemap's default selection of the top left tile of a single tile object as its origin tile, while in this case it would make more sense for it to be the bottom left tile.
I am not sure precisely how to resolve this or if there are other approaches that could be equally effective.
I have tried using a YSort node and swapping the hierarchy of my player/tilemap nodes without success. Changing the tilemap tile origin does not work, as it seems to only refer to the origin tile and not the object as a whole.