Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Tile automation (or brush?)

Discussion in '2D Experimental Preview' started by diegzumillo, Jul 31, 2017.

  1. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    Hi all

    I started a small project just to explore these new features, seeing what can be done now and all that. I noticed there's a lot of flexibility in the system because we can extend from tile and brush but I couldn't make any of that work yet (robodash doesn't compile).

    Anyway, I got attached to my small project started to explore the beta and now I'm considering switching to the latest stable version with my own simplified tile system to continue working on it. Unless I can find a way to do what I want with the systems currently in place. Basically, each sprite has a back and foreground parts. There are ways of doing that, and the simplest way is probably using two sprites. But I don't want to put them by hand, instead I'd like to put one and it would automatically pull its correspondent foreground part and put it on the neighbor tileset with same position. Any ideas? Is this something that could be done with my own brush and a programmable tile? (things I couldn't explore yet)
     
  2. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Can't say for sure what you are trying to do, but...

    Tilemap can only render one Sprite per cell so the Tile output is single Sprite. However, it is completely up to Tile to have any kind of logic deciding what to output.

    So assuming FG and BG tilemaps, you could have same Tile sitting in both. For FG tilemap, the tile logic would output foreground sprite and for BG tilemap, the tile logic would output background sprite.

    The problem is that default brush only paints to single tilemap, so you'd need a custom brush to paint to both simultaneously. Alternatively you could have some Editor code running that keeps two tilemaps in sync.
     
  3. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    A fake perspective thing for a platformer. Like the original prince of persia. Some parts of the sprite need to occlude the player, others don't. So I'm willing to draw the background and foreground parts of the sprite separately but I'd like to only have to put one of them in the editor and the other followed automatically.

    I'll have to look into custom brushes. Seems like a lot can be done with that!