I made a input for switching from third person to first person but I can't control the first person camera, it only works when the character is moving and only moves side to side can you help me?

I made a input for switching from third person to first person but I can’t control the first person camera, it only works when the character is moving and only moves side to side can you help me?