How do I get the following code to only follow on 1 axis?
using UnityEngine;
using System.Collections;
public class Follow : MonoBehaviour
{
public GameObject Subject;
private Vector3 _offset;
void Start ()
{
_offset = Subject.transform.position - transform.position;
}
void Update ()
{
transform.position = Subject.transform.position - _offset;
}
}