LookAtCameraYonly causing issues

using UnityEngine;
 using System.Collections;
 
 public class LookAtCameraYonly : MonoBehaviour
 {
    public Camera cameraToLookAt;
 
    void Update()
    {
        Vector3 v = cameraToLookAt.transform.position - transform.position;
        v.x = v.z = 0.0f;
        transform.LookAt(cameraToLookAt.transform.position - v);
    }
 }
Assets/Standard Assets/Scripts/Testing/LookAtCameraYonly.cs(4,15): error CS0101: The namespace `global::' already contains a definition for `LookAtCameraYonly'

Its causing my first person controller prefab to break once I save and reload, any ideas?

Thats an error I usually get when I open a script and edit it, then go to unity and re-organize my assets, then continue editing the script (which I moved) and saving.

Then I end up having two scripts, because the script editor saves to the old location.

Try to see if you have more than one file for that class.

whatever I did messing with the files (copy, pasting, deleting) worked, thanks :smile: