0
\$\begingroup\$

I have CharacterControllers as players in my multiplayer scene, and they got NetworkTransforms attached, with

  • Sync Mode = Sync Character Controller.

When I stop running with my character, my character stops on the other players' screens as well.

I've got MonoBehaviours attached to them, where I control the character's animations based on characterController.velocity.

The problem is this:

The animations won't stop because characterController.velocity is the same as it was when I was running.

This only occurs on non-local characters, because the local player got Local Player Authority checked, so its controller isn't synced from the server but to the server.

Why and how could I fix this? Thanks in advance!

\$\endgroup\$
5
  • \$\begingroup\$ did you try to send characterController.velocity ? \$\endgroup\$ Feb 13, 2019 at 17:08
  • \$\begingroup\$ Yeah, I could do that, but that's just a workaround, not really an explanation or correct solution :\ \$\endgroup\$
    – Tudvari
    Feb 14, 2019 at 9:37
  • \$\begingroup\$ can you update your question and add your scripts and insert gif or video that show the problem. \$\endgroup\$ Feb 14, 2019 at 14:05
  • \$\begingroup\$ can you upload a sample I need it for testing purposes \$\endgroup\$ Feb 14, 2019 at 15:48
  • \$\begingroup\$ Just create a character controller, sync them across the network, log their velocity and see that even if they aren't moving anymore, their velocity stays as it was during moving. \$\endgroup\$
    – Tudvari
    Feb 15, 2019 at 13:46

1 Answer 1

0
\$\begingroup\$

I think this is an issue originating from Unity's network code, so after a few failed tries, I just fixed it by calculating the velocity locally.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .