While evasive animations are not provided with MMLS at the moment, blueprint logic to implement an evasion system is already there. This guide will show you how to do it and give you a brief overview of network replication at the same time. You can see the end result in a short video at the end.
For demonstration we converted the DoubleJump animation into a front right (FR) evasive frontflip by playing with the root motion on the animation sequence.
Add server-side custom event
1. In your character EventGraph, right-click and type custom event. Select Add Custom Event and type ServerEvade.
–> All inputs in the character are on the owning client only. We need to send this information to the server. This is done by creating an event that is executed on server.
2. Click on your new event and then on the + in Inputs. Change the input to Enum Direction. Select Run on Server and check Reliable.
3. Hit Compile.
Add animations in your Anim BP
1. Add a new variable in your Anim BP, set the type to Enum Direction then select Map(Dictionary) as Container Type.
2. Select Montage in the 2nd variable type window.
-> Here you can create a custom structure instead if you want different evasive montage depending of state(Relaxed,Injured,etc.) or if crouching or proning.
Contact us if you want this & need help.
Final Character Setup
1. Hit compile if needed, then right-click and type the Server event we made earlier.
2. Drag & Drop MMLS Movement Component, pull from the output of the node and type Held Direction, select Client Current Held Direction. Plug in the event.
3. Drag & Drop your character mesh, pull from output and type Get Anim Instance, then from that output type the Interface Function name.
4. Repeat first part of step 7.2 but for Actions Blocked instead.
5. Add FIND, NOT, AND nodes and plug everything as shown in picture.
Add root motion to your animations
Add your montages in the Anim BP variable if not done already.
Everything should be working now
Some ways to improve the DoubleJump animation if you want to use it:
-> Split it in 2 or 3 parts, change the rate scale, put them all in a montage. Currently it does look like the initial frontflip rotation is a bit too slow. That is because we reduced the rate scale of the overall DoubleJump animation, it was not made to be a frontflip from ground.
-> In the video you can see that the character can rotate while under the effect of the root motion. To avoid this you can block horizontal mouse input with a Owner-only replicated variable while the montage is playing. Can easily be done with a custom montage window notify name, add it in the MMLS Movement Component (Event ServerPlayMontage). Then block the input with that variable in your character class.
-> Different montages by prone, crouch or standing. It would look way better especially the frontflip from prone. If you really want to implement this and need help contact us.
Assets sold on this website can only be used with Unreal Engine 4 or 5.
© 2023 Animated Logic Studios