Free movement with NetworkTransform & NetworkAnimator

My character character moves around the world using Animator with activated root movement. Basically, the AI โ€‹โ€‹system sets speeds on the Animator, which in turn controls the Animation clips that control the characterโ€™s movement. Since this is a standard feature that provides very realistic animations without noticeable slipping, I thought it was a good idea ... until I added network synchronization.

Character synchronization over the network using NetworkTransform and NetworkAnimation leads to a conflict between the two components:

  • NetworkTransform moves the character to any position of the host commands.
  • NetworkAnimator synchronizes the animation vars and plays the animation clips, as indicated by the host, while these animation clips also apply root movement.

The result is accurate (this means that the character reaches the target), but a very stuttering movement (noticeable jumps).

Removing NetworkTransform, the host and client instances of characters are desynchronized very quickly, that is, they will fall into different positions in the world when they are controlled only by a time-dependent animator.

Removing NetworkAnimator, client instances will not play the same animations as the host, if any animations at all.

, Animator ( ). NetworkTransform, , . 0,02 . .

NetworkTransform "Sync Transform", RigidBody CharacterController. : 9 ( ), 0,001, 5, = 1.

? , ...

+4
1

Root Motion , , .

, 1 , , 5: , Unity, 1 = 1 . 25 (0,25) 3 . 9 , .

0

Source: https://habr.com/ru/post/1680429/


All Articles