I have a 2 buttons, one moves a ship left a lane, one moves it right a lane. But I am trying to get it so as if the player holds the button down, it will increase a lane every 0.1 seconds.
At the moment it just increases 1 lane, no matter how long it is held for. I still want it to move just one if the button is released quickly, but if held I would like it to increase until released.
my code is below,
local buttonHandler = function( event )
if event.phase == “press” then
if event.id == “stop” then
lane = 1
elseif event.id == “+1” then
lane = lane + 1
elseif event.id == “-1” then
lane = lane -1
Can anybody help? Sorry if I don’t reply straight away, its late and Im off to bed!
thanks [import]uid: 8699 topic_id: 5178 reply_id: 305178[/import]