I actually disagree. Infact, it’s exactly the opposite.
It’s not a matter of opinion. It’s not the opposite either.
All games I have ever seen using iron sights (Day of Defeat source, Battlefield, Call of Duty…) implement iron sights just by animating the gun viewmodel to move to the center and apply camera FOV change plus depth of field effect. Camera stays still all the time. Camera represents the player position as well as the weapon line of fire origin point and camera orientation represents the line of firing rayCast vector. The gun orientation and muzzle point is irrelevant to the rayCast that is used to fire.
What if you zoom and shoot at the same time? in a cross-networked game you will end up with a messy glitch that is somewhat hard to fix.
What do you mean? Because of what I explained above it doesn’t matter what the gun view model does. This doesn’t result in a glitch.
Only the following variables are negotiated with the server: player location (equals to camera x,y, how they handle z varies), player orientation, crouch/jump/fire status. The negotiation happens through input (player tries to move and server gives clearance to it or denies it if the path is blocked) with the player client doing extrapolation until the server corrects it. Using the method of moving camera would result in just another float variable that needed to be synced with server for consistent playback.
So on contrary: if you move the camera location instead of gun viewmodel the following glitches (can) occur:
- camera goes through a wall
- player views the world different from where he physically stands
- rayCast vector origin point and direction are unclear
- player location and line of fire are inconsistent with player first person view and third person view
It doesn’t even make sense to move the camera from real world point of view. If you have ever fired a weapon while standing or especially moving you know that you can’t just take your head to the side to use the sights: you must bring the weapon in front of you so you can maintain your balance.
These problems were solved long ago and what I describe is true and well tested method.