For 2D/3D have a look at the "look_at" methods.
There are two possible ways to use it:
Use it on the gun to point the gun in the direction of the player, then when you create a bullet copy the angle to the bullet.
Use it on the bullet. When you create a bullet, set the bullet's angle to look at the player using look_at.