Instantiating a Rigidbody instead of a GameObject

In this tutorial: Instantiate - Unity Learn

The tutor Instantiates a rigidbody type variable.

public class UsingInstantiate : MonoBehaviour
{
    public Rigidbody rocketPrefab;
    public Transform barrelEnd;
    
    
    void Update ()
    {
        if(Input.GetButtonDown("Fire1"))
        {
            Rigidbody rocketInstance;
            rocketInstance = Instantiate(rocketPrefab, barrelEnd.position, barrelEnd.rotation) as Rigidbody;
            rocketInstance.AddForce(barrelEnd.forward * 5000);
        }
    }
}
  • Why doesn’t he Instantiates the GameObject of the said rocket? (Prefabs refer to GameObject and not Components)

-Whats the meaning of giving Instantiatate a parameter that is a Component and not a GameObject?
And when should I use each of those?

When you instantiate a component, you actually instantiate the whole gameobject and not just the component. Difference is the component of the instance will be returned by the method instead of the gameobject. This makes it more convenient for you if you need to use the component. It may also be faster because you don’t call getcomponent (especially if you instantiate thousand of objects). You should always pass the component to the method if you need the component of the instance, because all components have a reference to the gameobject which you can easily access but finding the component is a bit slower.

Don’t worry too much about it though, when people say a method is “slow”, it’s still pretty fast. Only worry when there’s a performance drop.