Ranged weapons glitch everytime I teleport or change humanoidrootpart position

Hello everybody,

There is this major problem I am having when I am trying to make ranged weapons in my game, such as lasers or rocket launchers, occurs when I teleport.

Here is what happens:

-Teleporting with a ranged weapon can mess up the position of where it fires, and can spawn projectiles very far away.

-Every time teleporting occurs, even without equipping the weapon, the position glitch gets worse.

Here is what I tried:

-Putting the position script inside the projectile
-Having the projectile’s parent be Workspace

After all that, the glitch still continues.

If you scriptwriters or troubleshooters could pass advice of what I need to be aware to fix this glitch, that would be great. Please do not give me a entire script. I am here to learn, not copy.