Change game objects single axis value based on rotation of another gameobject

How would I be able to control the lateral movement of a game object (table) using another rotating game object (steering wheel)? I currently can control the rotation of the steering wheel but am having trouble figuring how I would make the connections for the table to move to the right when the steering wheel is turned clockwise and to the left when turned counter clockwise .

May you bring a picture of the project? I’m not sure about what you are asking.

I think you just need to parent the table to the steering wheel (Drag the table inside the steering wheel)
Then, whenever the wheel turns, the table will also do it.

Warning Parenting is a useful tool, and you probably already know it, but for rotations don’t use non-uniform scaled objects.

If parenting is not the solution, You should then go through scripting, and I’ll be glad to help.

You could create a “ControlledByWheel” component an attach it to your table. So, you must reference your wheel in the inspector and it should (barely) work.

using UnityEngine;

public class ControlledByWheel : MonoBehaviour
  public Transform wheel; // reference to the object you want be controlled by
  public float factor = 0.1f; // how much "fast" you move
  float lastRotation;
  Rigidbody body;

  void Start()
    body = GetComponent<Rigidbody>();
    lastRotation = wheel.eulerAngles.z;
  void Update()
    if (wheel == null) return;
    float deltaRotation = wheel.eulerAngles.z - lastRotation; // EVIL!!
    deltaRotation = ClampedRotation(deltaRotation);
    if (deltaRotation != 0f)
      // Move the attached Rigidbody to Left/Right matching the change in
      // rotation of the wheel object
      var deltaPosition = Vector3.left * (factor * deltaRotation);
      body.MovePosition(transform.position + deltaPosition);
      lastRotation += deltaRotation;

  // A silly try to compensate EVILNESS of transform.eulerAngles
  // Only works for deltaRotation < 180
  float ClampedRotation(float angle)
    angle %= 360f;
    if (angle >= 180f)
      angle -= 360f;
    else if (angle <= -180f)
      angle += 360f;
    return angle;

Note 1: transform.eulerAngles is EVIL! It accepts and/or returns angles clamped/non-clamped by 360, but never the way you expect or desire.
Note 2: I assumed you want a RigidBody in your object in order to move it (recommended). In this case, consider making it kinematic too. But if you want to, you can use increase “transform.position”.