SetAnimator not working on controller?

Options
Hello,
I'm using Bolt 0.4.3.1 Debug.
I set up a player prefab in which state I imported the mecanim parameters from its animator. Each parameter is set to "Using Animator Methods". Every property has replication set to "Everyone".

In the Attached() method of the EntityBehaviour component of the player prefab I do the following:

state.SetAnimator(animator);
state.Animator.applyRootMotion = false;

if (entity.hasControl)
{
moveController.enabled = false;
}

where moveController is a script attached to the player prefab responsible for processing the commands the controller sends to the server. Also, moveController manages the animator (sets triggers, etc..)

The ExecuteCommand() does the following:

if (cmd.IsFirstExecution)
{
if (entity.isOwner)
{
moveController.executeCommand(cmd.Input);
}
}

so there's no prediction at all.

Now, the problem is that on the client which is also the controller, I don't see any animation when I move. The strange thing is, I can see the animations of a player if I'm not its controller. That is, if Client1 and Client2 connect to the server, from Client1 I can see the animations of Client2 when he moves and viceversa. But the clients don't see the animations of the prefab they control.

Any help is appreciated!
matte

Best Answer

Answers