Tiled/Unity and "changing tiles"

I’ll explain: I`m a beginner, watched a lot of videos on tiled and I feel comfortable working in it at a basic level.
I’m using it to develop in Unity, using a “tiled2unity” tool I found.
The elements placed in Tiled are being created as a “mesh” instead of a “sprite”, which make it difficult for me to interact with them.
It’s great with “background stuff”, but I ran into a problem when I used Tiled to place the “main character” and some “gate” objects (that need to open/close), because I want their sprite to change “live”.

  • Is it just a due to the fact that I’m new in Unity? Should I just try to be more familiar with meshes?
  • It it because of the way tiled2unity imports things?
  • Am I doing something that is not “meant” to be done in tiled (without some advanced changes)?

thanks in advance :slight_smile: [sorry for the length… :smile: ]

Hi itai, for the game you have in mind it is a good idea to split up all your game objects into two groups:

  1. Static - the stuff that, largely, doesn’t change over time (backgrounds, terrain, etc…)
  2. Dynamic - the stuff that reacts to state changes in your game logic (characters, enemies, doors, etc)

Tiled2Unity works very well with the static stuff and this this is baked into meshes in Unity. All the dynamic stuff is better handled with sprites. I still use Tiled2Unity in this case but more as a “placeholder”. In other words, I’ll have an object in my Tiled maps that tells me were a door should be spawned. Then, in Unity, I have sprites and behaviors that know how a door should behave once spawned.

Check out this post on my blog. The section “Adding Spawners With Custom Import Scripting” closely resembles what you’d like to achieve, I think. It will require a bit of custom code on your part but I’m afraid that’s part of the deal when it comes to making games. :slight_smile:

Best,
Sean

Thanks for the response!! I`ll definitely do the things you suggested (the placeholder thing) :slight_smile:
And I actually got to your blog before you replied (don’t remember from where), it looks complicated :open_mouth: [I will try to understand it though…].