Needed error, no idea what I did wrong.

Hey, again as stated, its saying I need a semicolon but I dont know where I need to put it.

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

public class PlayerShoot : MonoBehaviour
{
    public float shootSpeed, shootTimer;

    private bool isShooting;
    
    public Transform shootPos; 
    public GameObject bullet;
    void Start()
    {
        isShooting = false;
    }

    //update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Fire1") && !isShooting)
        { 
            StartCoroutine(Shoot());
        }
    }

    Enumerator Shoot()
    {
       isShooting = true;
       GameObject newBullet = Instantiate(bullet, shootPos.position, Quaternion.identity);
       newBullet.GetComponent<Rigidbody2D>.velocity = new Vector2(shootSpeed * Time.fixedDeltaTime, 0f);;

       yeild return new WaitForSeconds(shootTimer);
       isShooting = false;
    }
}
  • it’s IEnumerator not Enumerator

  • yield not yeild

  • GetComponent<Rigidbody2D>() not GetComponent<Rigidbody2D>