How to Spawn A projectile as a bullet in the same direction of the gun?

Hi. i wanted to spawn a projectile as a bullet but it moves just in one direction even if i aim to right and left.
i used a box as whereTospawn.

how can i use the direction of an attached arrow component to the gun as a direction to spawn?

we can use GetActorRotation to use the rotation of the gun itself and we can use the

GetComponentLocation to use the locatin of a box or arrow component where we want