I'm just learning Unity so maybe this is a stupid error, but I need help

As I said I’m just learning and I’m creating a simple platformer game, but I dunno why some errors appeared (I ran the game and it worked fine, but one second later the errors just appeared):

public class PlayerMovement : MonoBehaviour {
    private Rigidbody2D rigidB;
    private Animator animator;
    private SpriteRenderer spriteR;

    float speed = 2f;
    float xDirection;

    private void Start() {
        rigidB = GetComponent<Rigidbody2D>();
        animator = GetComponent<Animator>();
        spriteR = GetComponent<SpriteRenderer>();
    }

    private void Update() {
        xDirection = Input.GetAxisRaw("Horizontal");
        rigidB.velocity = new Vector2(xDirection * speed, rigidB.velocity.y);
 
        if(Input.GetButtonDown("Jump")) {
            rigidB.velocity = new Vector2(rigidB.velocity.x, 6);
        }

        UpdateAnimations();
    }

    private void UpdateAnimations() {
        if(Input.GetKey("x")) {
            speed += 0.7f;
        } else {
            speed = 2f;
        }

        if(speed > 7f) {
            speed = 2.5f;
        }

        if(xDirection > 0f) {
            animator.SetBool("running", true);
            spriteR.flipX = false;
        } else if(xDirection < 0f) {
            animator.SetBool("running", true);
            spriteR.flipX = true;
        } else {
            animator.SetBool("running", false);
        }
    }
}
public class CameraController : MonoBehaviour {
    [SerializeField] private Transform player;

    private void Update() {
        transform.position = new Vector3(player.position.x, player.position.y, transform.position.z);
    }
}

This are the only two scripts that I have and the errors are these:

E

It looks like you have duplicated scripts, delete the duplicate and the problem should be solved.

If you are using VS, if you change the name of the script in unity you need to close the script in VS and open it again, otherwise It will create a duplicate if you save

Edit: it will also create a duplicate if you move it

I’m looking in the scripts folder (I created it) and there’re only the two scripts and the .meta. There aren’t any duplicate

stop writing private void

That has absolutely nothing to do with it.

Are you looking in the right folder because the error says the folder is Scripsts not Scripts. It is possible you have duplicate scripts elsewhere in your project structure.

Forgot to add that moving the script (or folder) will also create a duplicate on saving

Please use the Getting Started or Scripting forums. Please only use the 2D forum when asking about 2D specific features etc. General C# scripting issues and typos or learning the language are not for this forum.

I’ll move your post to the scripting forum for you.

Thanks.