Cherno wrote:Not sure how weapon attack origins would be handled, though.
Basically you'll have to manage this manually, if you're designing a mod that has such a feature. I'm not entirely sure on this point, but assuming
the ViewPos is synched to the multiplayer gamesim and not clientside-only/renderer-only, the simplest way would be to have your weapons check the owner's view position offset when they fire. If for some reason it ends up not
being synched, you could do it the opposite way and have a custom player/weapon system that specifies an offset for firing when leaning, and then sync the ViewPos to that. Either way, it's perfectly doable.
Personally for my application, I'm going to try and use it only for visual effects such as custom view bobbing and recoil, and thus hopefully avoid issues with hijacking the player's aiming or movement controls, which is a major reason people complain about these effects. Also makes adding a camera effects scaling slider a lot easier, when otherwise such a thing could have gameplay effects for something that's supposed to be visual-only.
For example, this is what I've done for movement bobbing so far using ViewAngle/ViewPitch/ViewRoll. Notice how the player's "reticle" (which is projected into the world as an actor) remains pointed at the same spot even with (admittedly extreme) camera movement. ViewPos would be even better since I wouldn't have to "turn" the camera nearly as much to achieve similar effects.