Hi
Using the Tile properties in the Tile Editor, I setup a custom property on one of my tile and I’m trying to access that custom property via the event object and it doesn’t seem to work. I’m trying to access the property in the collision event of my player sprite.
for example, my player collision listener
function playerPreCollision(event) if event.other.mycustomproperty == 'ground' then print('player is touching ground') elseif event.other.mycustomproperty == 'coin' then print('player got a coin') end end
event.other.mycustomproperty always return nil. I’m able to get bodyType and other MTE recognized properties… but not my own properties.
I know I can get the properties of a tile from its location using getTileProperties, but it seems natural to access it from the event object. Is this something possible?
if not, what are the common/normal technique used to detect if the player is touching a coin, ground, or special object in a physical context?
thanks in advanced