Hello Guest

Author Topic: Moving platforms in a tilemap  (Read 4350 times)

zzeettoo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Moving platforms in a tilemap
« on: December 10, 2013, 12:55:12 pm »
Hi there.
I create a 2d platformer with basic tilemaps as my levels.
I implemented the character to stay on mofing platforms by using raycasts to detect them, etc...

My question is: how do i create moving tiles? Is there a way to do this within the tilemap painting or even in imported tdx data from the tiled-editor? Or do i have to create additional sprites, independent from the tilemap in order to have them animated? if so, what is the best way to animate them?

I read through different threads and most people said, that it is not possible to move certain tiles within a tilemap. But shouldn't it be possible to move them if created within an own tilemap object?
Or maybe having some tiles as prefabs as explained in the tilemap tutorial could be a solution?

Would be nice if anyone could come up with some kind of suggestion in which direction to go as i am reallly stuck right now.
« Last Edit: December 10, 2013, 12:57:38 pm by zzeettoo »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Moving platforms in a tilemap
« Reply #1 on: December 10, 2013, 02:20:09 pm »
You can't move tiles within a tile map, but you can create sprite tiles as shown in the tutorial (http://www.2dtoolkit.com/docs/latest/tilemap/tutorial.html). You'll need your own custom behaviour for moving platforms and attach it to the prefab. You won't be able to draw a full length and have the whole thing move though - you should create a placeholder sprite and have different platform prefabs you replace them with.

zzeettoo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Moving platforms in a tilemap
« Reply #2 on: December 10, 2013, 03:12:56 pm »
i'll have my try on that, thanks