Camera not viewing correctly (629195)

Greetings,
In my scene view my camera seems to be in the correct perspective however in the actually game it seems to be off and this is crucial to my game because the raycaat might seem off but in reality its not. Please help.
Thanks

What’s wrong about it? You say the camera is “off a bit”, but I can’t tell from the screenshot or post what’s wrong or what it should look like.

Could you explain the problem that is happening because the camera is off a bit? Could you also screenshot with your camera selected so I can see it in the inspector?

As you can see in the Game the gun doesn’t seem to be point at the cube, however in the Scene it is point at the cube, and my raycast picks up the cube, but in the Game it doesn’t seem like the gun is point at the cube.

However I might think that maybe its the pivot point, I’m not sure.

It’s because of the perspective of the camera. With a perspective camera, everything is stretched more at the sides, and objects that are closer appear larger than objects that are farther.

This is much like real life: Touch your finger to an object, obviously you’re pointing at that object. Now back up, but keep your finger pointing. Even if you’re still pointing at that object, it might not look like you are because of your perspective.

If you want your gun to line up perfectly with where is will shoot, you would have to put the muzzle of the gun in the exact center of the screen. That’s why the gun moves to the center of the screen when you aim down the sights in any shooter game.

If the perspective is too much, you can reduce the “FoV” on your camera to make things a bit more flat and appear to line up better.

I’ve tried that to it wont work.

I’ve figured it out, I have the camera and the gun rotating at the same angle and speed, and they have an offset to each other, thus I must compensate for this. I think I’ve got it.