FPS camera stops working when the game is built

I have a 3D scene in unity with an fps camera. The camera is on a different object which follows the player with a script. The problem is that the camera is not turning and is locked into a rotation when the game is built. The weird thing is that I use raycasts from the camera’s forward, and these raycast actually hit different things, so it seems like the camera is rotating but the image is not moving at all. Could someone please help me with this? I am completely lost.