Player not stopping during game over.,Player not stopping during gameover screen

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

public class PlayerController : MonoBehaviour
{
public float speed = 20;
public float Angle = 20;
public Vector3 startPosition;
public Quaternion startRotation;
public GameObject gameOverPanel;
public bool gameOver = false;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    transform.Translate(Vector3.forward * speed * Time.deltaTime * Input.GetAxis("Vertical"));
transform.Rotate(Vector3.up * Angle * Time.deltaTime * Input.GetAxis("Horizontal"));
} 	

private void OnCollisionEnter(Collision collision)
  {

if (collision.gameObject.tag == "Obstacle Tag")

{
	gameOver = true;
	gameOverPanel.SetActive(true);
}

  }

}

you should check gameOver before your move code like:

if (!gameOver)
        {
            transform.Translate(Vector3.forward * speed * Time.deltaTime * Input.GetAxis("Vertical"));
            transform.Rotate(Vector3.up * Angle * Time.deltaTime * Input.GetAxis("Horizontal"));
        }