using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Target : MonoBehaviour {
public float speed = 2f;
public Transform leftPoint;
public Transform rightPoint;
bool movingRight = false;
Rigidbody2D rb;
}
void Start () {
rb = GetComponent<Rigidbody2D<();
}
void Update () {
Debug.Log("Frame");
}
}
Idk how to fix please help! 
Your functions are outside your class body (you need to move the closing brace on line 12 to line 21).
Usually “end of file detected” means there is a missing }. Every opening symbol like { or ( needs a corresponding closing symbol ) } for the code to be interpreted. Basically the compiler is telling you that it was looking for something like that but reached the end of the file before finding what it was looking for.
Edit: oops. Actually, you have the opposite problem. “End of file expected” means have too many closing symbols rather than a missing one
But this error was “end of file expected”, which is the opposite of that. Which generally means you had an extra closing symbol, or placed one earlier than you should have.
Yeah, I tried to edit my post before anyone noticed. 