# unity3d - Instantiate and fire bullet realtive to player rotation in 3D

This is a top-down view but in 3D coordinates, I would like to instantiate and fire a bullet from the player's gun. This script is on a spawner object at the end of the barrel. Also tried putting the script on the player itself but also didn't work.

GameObject projectile =  Instantiate (bullet, transform.position, transform.rotation) as GameObject;