Hi guys! I am totally new here, so my problem is probably less than interesting, but I couldn’t find the answer.
I want to use a GUI button to control my Player via messages.
for that I have tried to make a function and it works but not as wanted.
"local function move_left(self)
- self.input.x=-1 print(“KFDSK”)*
function on_message(self, message_id, message, sender)
- if message_id==hash(“left”) then move_left(self)*
function on_input(self, action_id, action)
- if action_id == hash(“up”) then*
self.input.y = 1*
- elseif action_id == hash(“down”) then*
self.input.y = -1*
- elseif action_id == hash(“left”) then*
--self.input.x = -1*
now, when I press on the keyboard, the “move_left” function works fine, it’s moving the player and prints “KFDSK” as my debug message. But when I press the GUI button, it only prints the debug text but the player character does not move. So it works, but not really works…
Could you help me on what I am missing?
Thanks in advance.