error CS1022: Type or namespace definition, or end-of-file expected and error CS1513: } expected

The unity log is saying the error messages in the title, and from what i can tell, it shouldn’t be. I am fairly new to c# and unity, so sorry if this is a basic fix.

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

public class Door : MonoBehaviour
{
    public float height;
    public float openSpeed;

    public CrosshairRaycast script;

    private Vector3 oldDoor = transform.position;

    // Update is called once per frame
    void Update()
    {
        private RaycastHit Hitinfo = script.Crosshairinfo;
    }
  
}

You can’t declare something as private inside of a method.

2 Likes