In my receiving script, I have this code:
-- sine_movement.script
function on_message(self, message_id, message, sender)
if message_id == hash("disable") then
self.disabled = true
elseif message_id == hash("enable") then
pprint(message)
self.anchor_pos = message.anchor_pos or vmath.vector3()
self.disabled = false
end
end
I send a message like this from another script on the same object:
msg.post("#sine_movement", "enable", { anchor_pos = go.get_position() })
The pprint
in the first code block prints out an empty table. So the message is definitely being sent, but the property is not being sent with it. What am I doing wrong here?