Why does my script change my player's position?

I made a script to pick up cubes in my game. It is supposed to send out a raycast and then parent the cube to my player and set it’s transform so it’s in the center of the camera instead of off to the side or something. When I hit the cube with my raycast, it parents to the camera but then my player position changes to 0,0 and I fall through my world.
Here’s the script:

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

public class Laser : MonoBehaviour
{
    public Camera PlayerCamera;


    void Update()
    {
        RaycastHit hit;
        if (Input.GetKeyDown(KeyCode.E))
        {
            if (Physics.Raycast(transform.position, transform.forward, out hit, 4.0F))
            {
                if  (hit.transform.tag == "cube")
                {
                    hit.transform.parent = PlayerCamera.transform;
                    hit.transform.gameObject.transform.position = new Vector3(0, 0, 0);

                }
            }
        }
    }
}

I’m trying to achieve a pickup cube effect like in Portal or Half-Life. Do I have the right idea, or should I be doing this some other way?

Changed the script a bit. It no longer changes my character position, but it does not center my cube either.

hit.transform.parent = PlayerCamera.transform;
hit.transform.position = PlayerCamera.transform.position;

I added a rigidbody to the cube and enabled gravity so it would behave more like an actual object, but now picking it up doesn’t work very well and it just flops around lazily.
Perhaps I should make the script disable gravity when the cube is picked up?
I’m more focused on figuring out how to center the cube in my player’s vision though.