how move 2D character relative to any resolution

I have a question please ,
im having a problem to make my 2D character move relative to my resolution , for example if my screen width is 800 , I move my character 5 units to the right , but in a width of 400 my character moves pretty quick to the right , its like 2 times faster : so for someone using a lower width will reach the side quickly since I always increment by 5 units.
is there a way to make my character move with the same amount on different resolutions (relative to the camera size) , or could you link me to a documentation about it ,and than you soo much .

The simplest way I can think to do this is:

float playerSpeed = 160f;
float unitsToMove = (float)Screen.width / playerSpeed;

In the resolutions you mentioned, 800 / 160 = 5 and 400 / 160 = 2.5.

Just update playerSpeed if you want the play to speed up or slow down.

Thank you soo much sir :slight_smile: