When I use “setCollisionByProperty” on a layer it doesnt change any of the collision keys on the tile objects. However if I use ‘forEachTile’ and set the keys to true myself it works. Is there something I am missing? Picture below shows my code and map.
Thank you!
Add
console.log(tile.properties);
What do you see?
Did you set tile properties in Tiled?
No I didn’t the tutorial I followed didn’t mention it or I missed it. Here is how my TIled looks right now.
I am assuming I have to add “canCollide” into custom properties? Are there any other custom properties I should add while I am doing this?
When ever I add anything to custom properties it appears in the properties in layer. tile → layer → properties
I think you select a tile in the tileset panel first.
You can assign any property as long you use the same in your code.