britzl / defold-input

Simplify input related operations such as gesture detection, input mapping and clicking/dragging game objects
MIT License
111 stars 26 forks source link

cursor.script doesn't really send messages to game objects. #8

Closed theoybema closed 4 years ago

theoybema commented 4 years ago

Hi,

I found an issue with the cursor script. It didn't seem to send any messages to my game objects. I think the problem is here: local function notify_event(self, game_object_id, game_object_group, action, message_id) -- pcall to check if the game object exists since it might have been deleted -- typically a cursorout message that is generated when the game object is deleted local exists, = pcall(function() go.get_id(game_object_id) end) Your error catching doesn't function, _because go.getid expects a URL and _game_objectid is a hash. It always throws an error, and not because the game object doesn't exists. I changed the function in go.get_position(game_object_id) because that function does expect a hash and then it seems to work.

I'm new to GitHub, so have patience with me. I haven't figured out pull requests yet.

best, Theo Ybema

britzl commented 4 years ago

Thank you! I've pushed a new version with a fix