Hey there
I’m trying to get a custom collider for my tiles. Because I made a few tile sets before and they all require custom colliders. They have this slight perspective to them, so a simple equare around would make objects seem like they were floating a few units above.
It helps to imagine the above image with a grid and look at the top left corner piece. That piece is entirely inside the grid, so the automatic collider puts the actual ground a little bigger than the actual surface defined in the image.
So I’m trying to come up with a solution. The first thing I considered is using custom sprite colliders. I opened up my sprite sheet and started defining the shapes, then set the tilerule to use the sprite collider. It works great. However, it was a pain in the ass to draw those lines and I would have to do this to every tileset!
Question: is there a practical way to reuse the custom physics shape of one sprite sheet in another?
Another question: Is there a smarter way of doing this using this tile system? Tile rule has an option for a gameobject to be inserted with the tile, which I could use to set up a collider by code with my own script, but the gameobject has no way of knowing which tile it is in.
I’ve implemented an auto tile system in Unity before, and most of these things were done in code, but I’d rather use this almost native system before digging up my ugly code that might not still work with current unity versions.
I also considered remaking the tilesets in a way that keeps the tip of the grassy part in another tile. The number of possible tiles increases very little. However this requires a tile system that can put tiles automatically in adjacent tiles. OR communicating tilesets, which I don’t know how to achieve with this tileset system.