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

Add blood to a tile map

Discussion in '2D Experimental Preview' started by cAyouMontreal, Jul 23, 2016.

  1. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Hi guys ! I would like to add some blood when the character is moving around on tiles (or killing stuff) and I don't really know where to start.
    I just thought I could create some sprite over a tile when the player is walking on it. And for that I need to access to a certain tile on the tile map, accessing its size and position to I can juste instantiate a sprite over with a blood texture.

    I searched into the class TileMap and I found some function called GetSprite or GetTile, but it asks me to provide a Vector3Int which is I guess coordinates. What kind of number is it ? It seems that the grid is pretty much infinite.

    And if you think about a better solution for my effect, feel free to share it with me :)

    Thanks !
     
  2. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    I guess I found out how to do that. After looking at other thread on this section I can now edit a tile on a tile map where the player is walking on.
    So I will have a second tile map in front of the first one, empty. And when the player will walk on a tile I will set the tile with some blood to the other tile map. It should work, even if it's not that "great" (precision is to the grid size).
    It's ok, in Super Meat Boy they do exactly the same :)