How should I use an object layer?

I am not sure how I should be using the object layers. What are some best practices for using object layers?

Object layers have two main uses:

  • Annotating the map with information. Some examples:
  • Marking special areas, like the exit area of a map, a spawn area for enemies, etc.
  • Drawing collision shapes that you may integrate with a physics library in your game engine.
  • Adding images or objects to your map that are free from the tile grid and may be rotated.

Each object can also have its own set of custom properties, which is not the case for tiles placed on a tile layer.

1 Like

I’m playing with the idea of drawing paths on an object layer and having my NPCs follow those paths. I’m making a vertical scroller, so I don’t know if using object layers for paths is the right way to do it.

Well, at least it sounds like a good approach. You’ll probably want to smoothen the paths a little bit in your game though.

Support for bezier paths is pending on the following pull request: