Hi, everyone, I am currently having a problem with attaching a plugin to a Tiled object using PonyTiled. As you may know, PonyTiled allows you to add custom code to certain objects on a map. I am having some trouble doing this. I have done it before, quite easily actually, I just don’t know why it is not working now.
Here’s the code I have so far:
local M = {} function M.new(instance) physics.addBody(instance, "static") instance.isSensor = true function instance:collision(event) if event and event.phase == "began" then if event.other.name == "character" then print("collided with door") end end end instance:addEventListener("collision") instance.name = "door" instance.type = "door" return instance end return M
I hope it’s not something really simple. I haven’t looked at Java in a few weeks and I need to get back into the swing of things.