Infinite movement using go.animate()

I tried to make an object move infinitely along the X axis by using go.animate() but the animation was not successful.

function init(self)
	msg.post(".", "acquire_input_focus")
-- enable particles
	particlefx.play("#trail")  
--animate X position
	go.animate(".", "position.x", go.PLAYBACK_LOOP_FORWARD, 100, go.EASING_LINEAR, 1) 
end

The above code was the logic added to the player object. Any help on how to animate the position infinitely is highly valued.

Are you making an infinite runner? If that’s the case then you probably want to keep the player object stationary and move everything else. At high x or y values you start losing precision in the shader.

Thanx for the response @britzl :grinning: Yes the game is an infinite runner. But the environment has some heavy animations and game objects. So I thought of moving the camera while positioning the environment sections relative to the camera position.

Heavy animations and game objects. In which sense are they heavy?

I think the consensus on infinite runners is that the camera is stationary and the rest of the stuff is spawned off screen, animated and deleted when off screen again.