Unity 2d shooting,Unity 2d shooting tank

I am making a top-down shooting game and when I spawn a prefab bullet it doesn’t get force.
This is the code for the shooting:
public void Shoot()
GameObject BulletInstantiate = Instantiate(BulletPrefab, FirePoint.position, FirePoint.rotation);
BulletInstantiate.GetComponent().AddForce(transform.forward * BulletSpeed);

You got it wrong in GetComponent and AddForce, AddForce are used in Rigidbody, in your case as your game is 2d, use Rigdbody 2d. You didn’t put any components in GetComponent, you have to put rigdbody2d.

First in the unity inspector add the Rigdbody2D component to your prefab bullet.

So in the script Do this:

public void Shoot () 
   GameObject BulletInstantiate = Instantiate (BulletPrefab, FirePoint.position, FirePoint.rotation);
   Rigdbody2D rb = BulletInstantiate.GetComponent<Rigdbody2D>();
   rb.AddForce(transform.forward * BulletSpeed, ForceMode.Impulse);