tilt method for android

hello i want to know how to make a character move left and right usiing tilt method

This will tell you how:

6944618--816551--Screen Shot 2021-03-17 at 7.14.09 AM.png

You can access the tilt feature by using Input.acceleration. See here in the Unity3D Documentation.

An example function to make movements up and down would be.

Vector3 movement = new Vector3 (Input.acceleration.x, 0.0f, 0.0f);
rigidbody.velocity = movement * speed;

The documentation asumes that your device is held parallel to the ground and is in the right hand so you might also have a look at Input.deviceOrientation (see here)