Hello Guest

Author Topic: TileMap Prefabs  (Read 6722 times)

howlomogo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
TileMap Prefabs
« on: September 27, 2013, 05:53:50 am »
Hi There,

I have a problem where my Tilemap Prefab values keep resetting to the values of the default prefab. They seem to stay for a while after changing them but will randomly reset to default.

For example I have a Turret Prefab which has public variables of speed, distance etc. In my default prefab they are 0,0 but these are changed for every instance on tilemap, So in the Tilemap renderer where the prefabs are I set the values to the appropriate values such as 7,8. They work fine but after a while they reset back to 0,0 without having changed anything on the original prefab.

I have used the Tilemap data to select a prefab on a certain tile(I haven't added anything to String, Int, Float and Enable prefab offset is unchecked). Then I just paint them in and changed their public variables via the Tilemap renderer data to change the values.

I am quite new to using unity so I'm not sure if I'm missing something or if the Tilemap prefabs can't have different values.

Any help would be appreciated.

Thanks.

howlomogo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: TileMap Prefabs
« Reply #1 on: September 27, 2013, 07:02:18 am »
Seems the tile prefab is reset to defaults if I make any changes to the SpriteCollection they are in.

Is this normal or have I set something up wrong? :o

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMap Prefabs
« Reply #2 on: September 27, 2013, 10:00:08 am »
What version of 2d Toolkit are you using? Prefabs should retain their values, so if you're on the latest, this may well be a bug.

howlomogo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: TileMap Prefabs
« Reply #3 on: September 27, 2013, 10:31:28 am »
I'm using 2.2 final.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMap Prefabs
« Reply #4 on: September 27, 2013, 10:37:53 am »
I'll investigate, your report does narrow it down quite a bit.

howlomogo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: TileMap Prefabs
« Reply #5 on: September 27, 2013, 11:06:42 am »
Awesome Thanks. I'll leave my SpriteCollections alone for the time being ;D

Lortimus

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: TileMap Prefabs
« Reply #6 on: September 29, 2013, 03:37:25 am »
Came here to report the same issue.  Using 2.2 final as well.

If you add or remove an item from the collection being used in the tilemap, then all of the instanced values are wiped.  You can add or remove items from the collection as long as the tilemap is in edit mode.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMap Prefabs
« Reply #7 on: September 30, 2013, 02:09:25 pm »
Please take a look at the fix posted here and try it out on your data if possible.
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,2761.0.html