Accelerometer x variable.

Hi, would anyone know how to have a character move of screen to the left or right then re-appear on the other side.

I’ve done it with the mouse ok with:

if((ball.x - balloon.width * 0.5) < -ball.width+20) then
        ball.x = display.contentWidth+ball.width/3
                
        elseif((ball.x + ball.width * 0.5) > display.contentWidth+ball.width) then
            ball.x = 0-ball.width/2+20
        end

But with Accelerometer plugged in it just sits at the edge but doesn’t go through.

Thanks,

Mark

I assume the ball is the player?

if ball.x \< 0 then &nbsp; &nbsp; &nbsp;ball.x = display.contentWidth elseif ball.x \> display.contentWidth then &nbsp; &nbsp; &nbsp;ball.x = 0 end

Thanks for the response, I have this sorted now. Part of the problem was because of the way I’d implemented ‘Corona remote’ incorrectly.

I assume the ball is the player?

if ball.x \< 0 then &nbsp; &nbsp; &nbsp;ball.x = display.contentWidth elseif ball.x \> display.contentWidth then &nbsp; &nbsp; &nbsp;ball.x = 0 end

Thanks for the response, I have this sorted now. Part of the problem was because of the way I’d implemented ‘Corona remote’ incorrectly.