2D endless scrolling game - Which method is best for moving objects without lags?

Simply put, I am developing endless 2D game, where you can move character forward or backward using accelerometer.

There are lots of objects and I don’t know which method is the best for moving these objects and not decrease performance of this game.

Method 1:
I only use movement on X axis using accelerometer on my main character (or Player) where is attached Main Camera. It means that only main character is moving on X axis and other game objects are staying on their X positions. I used this method first, but then I realized that if anybody got really far in this game, there would be a problem with values on X axis, because this number could be higher than maximum value of float number. Yes, I know that it is highly improbable, but it might happen.

Method 2:
I don’t use movement on X axis via accelerometer on my main character, but use this value as inverse in RigidBody2D.velocity of all other objects. It means that X position of my main character would always be 0 and if I use accelerometer for moving main character forward (right direction) then I use this value as inverse on X axis of all other game objects.

So which method is the best for moving objects in 2D endless game? If you have any other which is better, I will be very thankful for it.

Moving a single character is cheaper and more scalable. You can move the main character first, then when it go beyond a certain distance, just shift everything left so that the x coordinate of the character resets to zero.

Note that a properly implemented pooling system is also very important for an endless scrolling game.

You acknowledge yourself that the likelihood of anyone getting far enough for floating-point precision to cause an issue is highly improbable. As a generally accepted guide (and assuming you’re using 1 Unity unit = 1 metre scale), if you want millimetre-precision, you should keep coordinates under 10,000. If you’re happy with centimetre-precision (in worldspace), you can go to 100,000.
Is your character really likely to run more than 100km?

Use Occam’s razer - when given two choices, take the simplest (Method 1: move the player), and only worry about float precision if it becomes an issue.