How To Make Camera Follow Bullet?

I’m new in Unity game development. I am design a third person shooter game. What I want is when player fires a bullet camera should follow that bullet to its target.
What I did so far is:

camera.forward = shot.transform.forward;

Vector3 newTargetPosition = shot.transform.position + (Vector3.up2) + (Vector3.forward5);

camera.position = newTargetPosition;


Problem facing: When player turn back and fires bullet camera follow bullet from the front instead of follow that bullet from the back.

Please suggestion what/where I’m doing wrong?

Thanks in advance.

Maybe you should go simplier and temporary make the camera transform a child of your bullet GameObject, then back to your character controller when bullet hit target.

This way it wouldn’t be affected anymore by your controller position or rotation.

Unity Documentation on transform parent

take the position of bullet and change the position of camera according to bullet position