This is our first attempt at a multiplayer FPS game using UE4. We are going insane trying to set up a firing animation for our pistol weapon in 3rd person which lines up correctly with the current anim offset direction.
For example, if the char is aiming in a certain direction, the pistol firing animation (blowback) should play in the same direction that the player is currently looking in according to the aim offset (which is currently working). How do we go about setting this up?
Do I need to create a sperate fire anim .FBX for every single aim offset pose or is is something else to do with anim blending or montage? Please note that all character animations will need to be correctly replicated in multiplayer.
There are a number of ways; IMO, the easiest way is a local-space (not component space) additive animation.
You set up the firing animation on top of the base aiming pose, and set that base aiming pose as the reference. UE extracts the difference and understands the animation to consist solely of, for example, “arms/hands and gun move up and back and increase pitch slightly, then return to their original position” and plays that change in position on top of the current positions of those bones… So if the bones are rotated 60° yaw and -12° pitch, the anim still makes sense since it isn’t trying to play an absolute set of bone positions, just a measured change.
AnimMontages don’t replicate, full stop. The documentation says as much. Any anims you want to replicate will have to be played in some way that isn’t a montage.
Well, you’d have to come up with some way to play the animation natively. Like, take the inputs or commands which are replicated across the server and use those to play the corresponding animations on any visible actors on every local instance of the game. Or something, I’m terrible at netcode, but essentially that seems to be the crux of it; whatever state that causes those montages to play (some event or whatever) needs to be replicated across the server and those anims will need to be retriggered using that event manually at a local level.