setCollisionByProperty not working on my layer

Hello,
I’m super new to Phaser and have read about every thread on why my setCollisionByProperty doesn’t seem to be working, but so far nothings working. It simply isn’t registering the tables as collisions and the sprite can walk right through. I console.log the tablesLayer’s properties and am met with “undefined”. Heres my js:


and here’s my tiled when I set the custom properties:

:wave:

Is debugGraphics showing any edges?

No, this is what’s seen by the debugGraphics:

Add

console.log(tablesLayer.getTilesWithin().filter(t => t.properties.collides))

If that’s empty, add

console.log(tablesLayer.getTilesWithin().map(t => t.properties))

and look for the property data there.

If it’s not in there either, look in the map JSON.

This is what I see in my console:


This seems normal since I set custom collisions for my wall as well?

Then this is what I see if I click the drop down:

It looks right except 'true' is a string. So you could change the property type in Tiled and reexport, or you could change your Phaser code:

tablesLayer.setCollisionByProperty({ collides: 'true' });

:face_with_open_eyes_and_hand_over_mouth: :face_with_open_eyes_and_hand_over_mouth: :face_with_open_eyes_and_hand_over_mouth:

well that’s embarassing. While I have you though… I’ve also been trying to set up custom colliders i.e., define table edges and such. I have all the custom collisions set up as you can see in my original screenshot. Currently, it doesn’t actually change anything. Do you know if there’s a thread you could point me towards? or maybe you’d know why?

I maybe haven’t done this. :slightly_frowning_face: Which feature is it in Tiled exactly?

It’s the Tile Collision Editor in tiled, it just basically allows you to resize the collision boxes so it’s not the whole tile but rather specific portions of it. Can’t quite figure out how to link it up with phaser though :frowning:

I think this is in