In my .gui_script, specifically at function on_input(self, action_id, action),in a specific button touch event, i wrote:
if action_id == hash("touch") and action.pressed then
local gotKlicked = gui.get_node("KlikContinuearea")
local setText = gui.get_node("textField_vec3_touAR")
if gui.pick_node(gotKlicked, action.x, action.y) then
msg.post("bearAnim#bearanim1st", "getrid" )
end and so forth…
contains the receiver address (using relative addressing) and a message_id “getrid” to control a game object to just disappear out of screen which in (receiver.script),at function on_message i wrote:
if message_id == hash("getrid") then
local from_position = vmath.vector3(821, 345, 0.6)
local to_position = vmath.vector3(1320, 345, 0.6)
go.animate("#Bear", "position", go.PLAYBACK_ONCE_FORWARD, to_position, go.EASING_OUTBACK, 2.0)
print("taking down the bear")
end
end
i touch the button and the bear didnt move out, how do i make it work? seems like i still got pretty confused with the main concept from Button touch events or perhaps it was the message passing mechanism that i wrote wrongly?
Running Defold 1.3.7