How To Check The Neighbourhoodiness Of A Tile

So, we all know rule tiles. However the thing I want to do is, instead of the same type of tile, whatever tile is neighbour with that tile, it would change.
Let me give you an example:
If there is a block under this tile, it’s sprite look like this:(Whatever tile is it)
5224637--520808--pixil-frame-0 (22).png
And if there is not any tile under it, it should look like this:
5224637--520811--pixil-frame-0 (21).png
You get the idea.

Here is a nice thread for you to read:

If you do not have the content here that you seek @blu3drag0n could perhaps answer your question or possibly add this in the Official Tile thread?

@aybarsmete1

You can achieve this with scriptable tiles. Just check if there is tile below and not above and draw sprite 1 and so on.

2 Likes

I don’t know the code…

Hi again @aybarsmete1

I’ll say this - did you actually bother to google for this?

As Unity has given one example in manual, and more in 2d-techdemos - no need to start inventing it yourself!

I find Tilemap pretty convoluted to use from code… and IMHO these examples are really helpful. If you read the tilemap code examples, you will also see how they did the directional “does tile exist in direction x” kind of checks too. You don’t have to read rule tile’s code, which contains pretty much everything from other (scriptable tile) examples.