#Network Animator not synced

1 messages · Page 1 of 1 (latest)

loud fjord
#

Hello,
I am fairly new to NetCode. I am trying to make a moving platform that players will be parented to. I have given the platform a simple animation that moves it in a circle.

My issue is with syncing the location of the platform. When I start two instances of the game, the animation begins to run, I cannot start both instances of the game simultaneously, so the animations are not lined up. When I host on one instance of the game, the animation continues on with no problems. But when I join as a client, the clients platform animation does not update to where the host's platform currently is in it's animation.

The platform has the following components:
NetworkBehavior
Network Object
Network Trasnform
Animator
Network Animator referencing the other animator

I have tried looking at the documentation for Network Animator, and it says it's server authoritative by default. So I'm not sure why it's not looking at the server for the position in the animation.

haughty yarrow
#

The easy way would be to put a network transform on the platform and move the position directly. If its a complex animation then you should be able to use Root Motion and it would still work. In that case only the server would need to run the animation and I believe the transform will still sync

loud fjord
#

Hello, thanks for the quick response.

The animation is currently simple, but will end up being pretty complex as the project progresses, so I think it will need to be an animation with root motion applied.

I tried applying root motion just now. The movement of the platform was pretty strange, so I'll have to dig into that. However, that did sync the animation...

Do you have any idea why that makes a difference? Shouldn't the position of the platform on the client come from the location in the animation of the server? I'm confused why that has an impact. I'll do some research on that. but if you have an explanation, that would be appreciated.

haughty yarrow
#

Animation without root motion will not actualy change the transform so there is nothing to sync in that case.