i have three button.
- attack
- left
- right
how to perform when i touch right+attack (my object will attack the right side)
or
when i touch left+attack (my object will attack the left side)
please someone help 
i have three button.
how to perform when i touch right+attack (my object will attack the right side)
or
when i touch left+attack (my object will attack the left side)
please someone help 
You can define a simple flag to do that on top of the scene file.
local isRightPressed = false local isLeftPressed = false
After that, you need to change those flags when that button is pressed.
local function handleButtons(event) if (event.phase == "began") then if (event.target.id == "left") then isRightPressed = false isLeftPressed = true elseif (event.target.id == "right") isLeftPressed = false isRightPressed = true end elseif (event.phase == "ended") then isRightPressed = false isLeftPressed = false end return true end
After that, you will need to check those flags when the attack button is pressed and act accordingly.
You can define a simple flag to do that on top of the scene file.
local isRightPressed = false local isLeftPressed = false
After that, you need to change those flags when that button is pressed.
local function handleButtons(event) if (event.phase == "began") then if (event.target.id == "left") then isRightPressed = false isLeftPressed = true elseif (event.target.id == "right") isLeftPressed = false isRightPressed = true end elseif (event.phase == "ended") then isRightPressed = false isLeftPressed = false end return true end
After that, you will need to check those flags when the attack button is pressed and act accordingly.