How to create a particle system under water that follows the player?

Hey everyone,

ok, I am working on a 2D Sidescroller. My character can swim. So I know when it is under water and when not.
Now I tried to instantiate a ParticleSystem when under water.

       //Checks if the player is in Water
      void   OnTriggerEnter2D(Collider2D other) 
        {
        if (other.tag == "Water")
            {
                isInWater = true;
                anim.SetBool("inWater", isInWater);
                rb2D.gravityScale = -0.01f;
                rb2D.drag = 0.5f;
            Instantiate(BubbleEmitter, transform.position, transform.rotation);



        }
        else
            return;
        }

          //Checks if the player is ot of Water
     void    OnTriggerExit2D(Collider2D other)
    {
        if (other.tag == "Water")
        {
            rb2D.gravityScale = 1;
            isInWater = false;
            anim.SetBool("inWater", isInWater);
            


        }
        else
            return;

Ok, now this Instantiates it as whished but it does not follow the player.

So I tried to set the parent. But I got the error message that I can not set the parent of a prefab.

How can I achieve this?

Thanks a lot for your help.

Try adding a particle affect as a component to your game object, when out of water, set it to be unattractive, when underwater set it to active.

Thanks for the answer. I have hoped to find a good way not take it with the character all the time but to instantiate when under water and destroy when over water. But maybe I’ll go with your solution.