Weapon fire anim according to Aim Offset direction

Hi. This should be an easy one for you:

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.

d4a6189b009edd1795789bbd11fa5652e2610946.jpeg

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.

Any help would be highly appreciated. Thanks :slight_smile:

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.

I mean, that’s how I did mine anyway.

Thanks for the help. Problem solved, but there’s still one more little issue:

How can I replicate this animation in multiplayer?

This is in the InputAction Fire. It doesn’t replicate in multiplayer. Why?

I can’t find anything about an AnimMontage replication. Waiting for someone that can do this, because I’ve got the same problem.

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.

I need to replicate the state of the AnimMontage accross the network, as the documentation says, but the problem is: how?

http://puu.sh/cfaC8/63c9070fd4.png

So basically we’re screwed? There’s no way of replicating these animations? Surely…

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.

Done with two events:

  1. Run on server from client
  2. Run from server multicast

and on the second event I put the Montage Play event.
Thanks for the help.

What if you are trying to do this with a montage (because root motion)?

Your playing the animation montage on the server only, you want to fire a multicast event after the server event to replicate it simple as that.