How do i sync up 2 animations together?

guys, I’ve this basketball player which has all sorts of animation, like running left/right forward etc… and this pack also has a ball mesh which is a skeletal mesh with all sorts of animations like bouncing of the ground or being handed over to another player. now my problem is I don’t know how to sync up these two different animations together so that the ball is always attached to the player’s hand but its also playing its own animations.

as you can see the ball is supposed to be attached to players hands.

but the ball also has its own animations so I cant just attach it to the players hand.

could someone help me how to sync them up?

Create a socket on the players hand and use AttachActorToSocket to attach the ball to it

i did definitely think of that. what about animations?

As long as the ball has root motion animations you’ll be fine.

Socket binds to the root, so the ball can bounce and do non-IPC movement.

For a ball bouncing, you’ll probably want to do something like an AimOffset with the ball so you can control the max bounce height relative to the players hand height.

1 Like

Usually the ball player animations would include a ball bone that you attach to which is also animated.

Trying to keep animations in sync otherwise is near impossible. Particularly across Sequences.

The only way to control a “sub” sequence effectively would be for the master (animation which drives the other) to have a curve value of the frames included in each animation so as to be able to sync the slave (animation receiving play instructions).

If you attempt to play the 2 animations concurrently they could still go off.
I suppose sync groups can be hacked to do this too.

guys this is how it looks like when its attached with no animation


this is how it looks like with animation playing. its way off

also when i enable the root motion it stops doing anything, it behaves the same as not playing any animation

So then the socket is probably on the root of the character and the items are split off into 2 different animation sets, which is hardly ideal.

Are you sure / did you check that there isn’t a bone you can use specifically in the player’s hierarchy ?

And I don’t think the ball can have root motion on since it’s not a character per-se.
The whole point of the root motion system in unreal is to convert animations from animations to character movement…

the ball has root motion animations.

the socket is also attached to the Hand_R and when I set a preview mesh its positioned in the right spot.

Share screencaps of the skeletal hierarchy of the ball player. Both text and with highlighted bones in persona.

That said, if the animation is playing off to the top right when playing it’s most definitely attached to the wrong source and possibly also flipped on the X axis.

Just because the preview mesh is OK doesn’t mean it’s the right spot. You could use a cube as a preview mesh and it would probably be OK too.
The animations aren’t taken into account when previewing. usually.

Is the ball a child of your skeletal mesh?
If so, In the details window did you select the socket to connect it to (hand_r)?
If not, how are you attaching the ball to your character (using what functions or methods)? (show code)

Share a full screen shot of the viewport of your player character, if the ball is a child, please and click on the ball so we can see the Details.

Also, how are other players going to interact with a ball that is within your character’s blueprint? Ideally, the ball would be it’s own blueprint or object that way you can have the ball manage its own physics and other players can take the ball, or your player can throw the ball, or drop it and allow it to be interacted with.

I would creat an AC in the player and on Overlap you attach component to component int the Ac why Actor component you Ask? becouse your guy like to play with friends. Ok go on. Creat an AnimBP for the Ball and a BallAction Interface call that everyone is tallking about the same ball (cast to sucks). In the Balll anim BP and in the Player animBP you run than the best Funktion FUnktion in the World


And they will be trigger in Every Player with something like this If you have a current player in the ball and is Valid the Ball will get all Values the Controll player tell hime while not Valid Player Can´t Influence him. So if you set the Movement action in the palyer to Dribble ore hold ore what ever the player and the Ball anim bp will get the info at the same time. You can send not just play animation you can send Valuse like speed and and and … GL HF. I should

Not a bad theory, but in practice the interface isn’t a precise enough trigger to “sync” things.

The call isn’t necessarily instant as it can be delayed by the game thread.

If you are trying to time the dribble between the actor animation and the ball animation - without attaching the ball to an animated bone inside the character - you’ll almost always have sync problems.

Also, I seriously doubt you would have the ball have its own animation blueprint or even be a skeletal mesh in a game.
It would serve no purpose. The ball doesn’t have any joints. It can live attached to other things…

And bounce distortion should 100% be done via material… regardless.
Since soft objects in unreal do not exist.

It sounds like it would be much easier to just include the ball in the skeletal mesh and its animations, then scale the ball bone to zero to hide it whenever the character is playing an animation in which he does not possess the ball. More content creation work, but 100% reliable for keeping things in sync.

The mesh serves no purpose as a part of the character mesh and the end result of attaching to an animated bone is going to be 100% identical.

You can easily add a mesh for visualization in blender that doesn’t export with the rest of the rig. If your concern is “how do I animate this bone?”.

Also, if it’s part of the character mesh then other characters wouldn’t be able to interact - if this is for game application.

guys let me give u an update as to what happened.

all I had to do was put the ball as a child of the character mesh and set its animation blueprint. and everything seems to be in sync, which I think is bcz the ball and the character were animated in the same position and at the same time then they were separated before exporting which explains why they are in sync.

the animbp is also very identical to character bp cuz it uses players speed to change the animation that is being played. for every character movement there is also a ball animation like running, idle, jog left, right, etc…

1 Like