Make actor copy animation state of another?

Hello,

I’ve made a water shield effect on my actor by using a second mesh with a tessellation material on it.

The problem is that when I play the scene, the animations are not in sync!
I’ve tried a ton of things to make them work, but they always end up playing out of sync, so his idle/run/etc animation moves differently than the water mesh.

How can I set the water mesh to be at the same frame as the original animation?
(Instead of just giving them the same AnimationBlueprint and crossing my fingers)

Thanks!

Note: I also need to use a 2nd inner mesh with custom depths for a proper fresnel shader, so this would help me out there also. :slight_smile:

Hello Juice-Tin,

Are you calling all of the exact same animations on these two meshes but they’re still out of sync? How are you going about setting up and/or calling your animations? We would need more details about the surrounding elements to see where the problem is.

Hi ,
I have an actor with 2 meshes, each with this extended AnimInstance class:

Next, in my actors Tick method, it sets all his animation variables as needed:
(An example below, however all the values are set throughout the Tick method)

At the very end of the Tick, it copies his main animation data into the 2nd mesh’s animation with this function:

This should theoretically make them identical as they always leave the Tick with identical AnimInstance values. The 2 meshes do play through the right animation states, however they are not in sync, the second mesh is always a little behind.

(Shown here with a darker material)

That’s why I ask is there’s any way to directly copy the anim state of another animation, as it seems even with the exact same AnimInstance variables at the exact same time, they still play out slightly differently. It’s like this the moment the scene plays. The desync amount seems to be random when the states change.

Thanks for checking this out, I’d be happy to give any other info as needed. :slight_smile:

I’m having exactly the same issue with my project as well. I’ve got an ice material that I apply to my actors to indicate being frozen. The animations never sync up despite duplicating every animation property that I can find.

Unfortunately it seems that his delay isn’t something that can be avoided when attempting to copy anything related to animation. Applying the animation blueprint to both of the meshes would be the best way to go about doing this without having the delay. I just attempted it in the ThirdPerson template with the default mannequin and didn’t receive any delays or inconsistencies.

Edit:
After more testing, very basic things such as the thirdperson will be synced, yes. My character also starts off synced as well, however any complex movements or small scene modifications such as changing the material, creating a particle, etc, creates syncing issues.

Ex: When the main mesh’s material was changed to a fresnel material, it became permanently de-synced. This also happened when the water tesselation material became visible, after a number of acrobatic movements, etc. (Look at the top/bottom of the hair)

It’s much more visible on large/fast movements, and when using the custom depth pass with transparent fresnel materials.

Note: Armor and Weapons are attached(children) to the main mesh. Could these factor in the reason it’s slows down or gets de-synced?

Apologies if I’m suggesting the obvious or asking a stupid question here, but why would you guys take the approach of using two distinct meshes instead of a single mesh with a more complex, additive material (where the water and or other effects can be switched on or off)?

The main reason I need it is for transparent fresnel which requires a second mesh to be used for custom depths. My game is heavily based around that effect.

Also for things like the water barrier in the first image, you can see it’s physically around the player and not just applied to the base material (its also wavey while the player inside it is not)

Finally found a solution, despite what everything seems to say, do not put the depth/2nd mesh parented to the first mesh.

This will never sync properly (unless the project is super basic like the 3rd person):

This will allow both mesh’s animate in perfect sync if their anim values are the same
(just parent them both to some other object, so they are beside each other):

Not sure if it’s a bug with recent unreal releases, but simply not parenting one mesh to the other does the trick.

Hi there, here to necro this thread, because I had the same problem with secondary meshes that were used as Clothing and another one that needed to copy the AnimMontages:

In the construction script of your character, pull out a Set Master Pose Component node, connect the child mesh on target and the Parent on New Master Bone Component, and that should do the trick…

Please create a new post about your particular issue, as this has been resolved for a very long time.

Actually, the answer I accepted was just a workaround that never actually worked properly. I only recently discovered SetMasterPoseComponent which is the correct way to do it.

If Rumpelstilskin wants to change his comment into an Answer I’d gladly accept it so this question will have the right answer for anyone else seeing it in the future.