Linking second entity to the player's mannequin


I've been experimenting with Mannequin in our team project, and met a certain problem related to attaching additional entity to one.
In our game there's a human character playing with a ball. Ball is a separate entity and may be thrown around and caught again. Since when in player's hands the ball should be following character's movements, we apply two animation clips: one for the human character and another for the ball.
Note that we have considered simply attaching ball to the player's hand bone, but thought that won't work well since animations involve player throwing ball around, passing from hand to hand, and so on.

For the mannequin I've configured two scopes and contexts: first one for the human and one for the ball. Fragments that are run when the player owns a ball play clips on both scopes at once.
When player takes the ball I activate the related contex using ActionController.SetScopeContext (in C#) where I pass reference to the ball's Entity and character instance. When player looses the ball I use ActionController.ClearScopeContext to "disconnect" ball context from the mannequin.

Now, this works more or less well for the most times, but there is one issue. Whenever the ball gets connected to the player's mannequin its "bone" is positioned at the center of model coordinates (I hope I use the correct terminology here). When the animation begins to play, it smoothly blends to the position that is dictated by animation frames and follows animation afterwards until context gets disabled again.
I tried to get rid of this initial transition by removing blend time from all the clips in fragments, but there is still at least 1 rendering frame when you can see the ball in the center of coordinates before it blinks to the correct position. This is especially bad for animations which start with ball far away from the zero coords (such as being caught when dropping from above, etc).

My question is: do I use mannequin system properly as it is supposed to be used linking entities like that? How would I solve the above problem and force the ball to the first animation's frame position during same update as I attach it? Is this done with animation controller at all (I was considering to try and reposition the skeleton joint programmatically)?
While we are at it: what's the practical difference between connecting another entity as a second context and connecting another action controller as a "slave" using ActionController.SetSlaveController?

Re: Linking second entity to the player's mannequin

After further testing it seems this may not be an issue with mannequin itself, but common behavior when you start a skeletal animation. When an animation is first played, it always begins from some default "pose" from where it blends into the position dictated by animation frames. Which perhaps makes sense; but then, how do people normally implement transition between an entity moving as a separate object and entity being a part of animation, like in the above example where a ball is being caught by the human character?

(Probably this is not a programming issue at all then...)

Who is online

Users browsing this forum: No registered users and 1 guest