I have problem moving my bike right and left using gyro, accelermeter, for VR bike game

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movement : MonoBehaviour
{public float speed = 1.0f;
public float tiltThreshold = 0.1f; // Adjust this value to set the tilt sensitivity

private Quaternion startRotation;
private Vector3 moveDirection = Vector3.zero;

void Start()
{
    startRotation = Input.gyro.attitude;
    Input.gyro.enabled = true;
}

void Update()
{
    moveDirection = Vector3.forward * speed * Time.deltaTime;

    Quaternion rotation = Input.gyro.attitude;
    float tilt = rotation.x;

    if (tilt < -tiltThreshold)
    {
        moveDirection.x = +Input.gyro.userAcceleration.x*  tilt * speed * Time.deltaTime * Mathf.Abs(tilt);
        Debug.Log("Gyroscope tilted to the left. titlt is: "+tilt );

    }
    else  if (tilt > tiltThreshold)
    {
        Debug.Log("Gyroscope tilted to the right. titlt is: "+tilt );
        moveDirection.x = -Input.gyro.userAcceleration.x *  tilt * speed * Time.deltaTime * Mathf.Abs(tilt);

    }
    else
    {
        Debug.Log("Gyroscope in an ideal position.");
    }

    transform.position += moveDirection;

}}

public class Movement : MonoBehaviour
{
private Rigidbody rb;
private float dirX;
public float moveSpeed = 20f;
//public float clampX = 7.5f;

void Start()
{
    rb = GetComponent<Rigidbody>();
}

void Update()
{
    float moveForward = moveSpeed * Time.deltaTime;
    transform.position += transform.forward * moveForward;
    dirX = Input.acceleration.x * moveSpeed;
    transform.position = new Vector3(Mathf.Clamp(transform.position.x, 43, 53), transform.position.y, transform.position.z);
}

void FixedUpdate()
{
    rb.velocity = new Vector3(dirX, 0f, 0f);
}

}