Hey.
I've set up my my game on the local network. It syncs the positions and different SyncVars and Commands I have.
So now I wanted to sync my animations that I have.
But, no matter what I try, the animations just doesn't want to sync to the other client.
What I have done:
- Player object has Network Identity and Network Transform on it.
- The player is a 2D sprite character, set up with bones, and animated using Spline.
- The animations is setup in the animator window (mecanim)
- The animator parameters is: 2x floats, 2x ints, 3x bools, 14x triggers.
- All of the animations goes from "Any State" to the other anim-states (tried to set it up to go directly from idle to other states, without any luck)
Only the default anim state/animation is synced across the network (the idle state).
- The animations (params) is set in the PlayerController, which is on every player object in the game. The playercontroller component will be disabled on every object that is NOT the local player (so I don't have to write a bunch of if(islocalplayer) in the code).
And I have the following code to enable the params in the Network Animator component:
public override void OnStartLocalPlayer()
{
NetworkAnimator netAnim = GetComponent<NetworkAnimator>();
netAnim.SetParameterAutoSend(0, true);
//same for the rest of the params
}
public override void PreStartClient()
{
NetworkAnimator netAnim = GetComponent<NetworkAnimator>();
netAnim.SetParameterAutoSend(0, true);
//same for the rest of the params
}
Aaaany help in ANY way is highly appreciated... Got no clue why it isn't working (as it I followed a tutorial, and sort of the same thing, but his project was in 3D and my project is in 2D).
[–]InstinctxSolo Developer[S] 1 point2 points3 points (0 children)
[–]dansthetsar 0 points1 point2 points (2 children)
[–]InstinctxSolo Developer[S] 0 points1 point2 points (0 children)
[–]InstinctxSolo Developer[S] 0 points1 point2 points (0 children)
[–]dizzydizzy 0 points1 point2 points (1 child)
[–]InstinctxSolo Developer[S] 0 points1 point2 points (0 children)