com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

AnticipatedNetworkVariable using Anticipate on server fails

Open marcusx2 opened this issue 6 months ago • 4 comments

Description

Docs says that calling Anticipate on server changes both the anticipated and authoritative values. This is not true for my use case. If I change AuthoritativeValue directly it works, but if I use Anticipate it doesn't.

Actual Outcome

The documentation leads me to understand that calling Anticipate on the server is the same as setting AuthoritativeValue on the server, but that is not the case.

Expected Outcome

Anticipate and AuthoritativeValue should work the same when using on the server. But the result on client is different.

Additional Context

If it matters at all, this isn't a "simple" variable. It's a AnticipatedNetworkVariable<List<int>>

marcusx2 avatar May 09 '25 02:05 marcusx2

Thank you for reporting this! Do you mind adding more detail around the code that you're using and the results from that code that you're seeing?

EmandM avatar May 12 '25 14:05 EmandM

I don't have anything specific to share, just that when I set AuthoritativeValue on the server it works, but when I use Anticipate it doesn't. And it doesn't always happen, I used Anticipate on the server before successfully, so I think it's something specific with AnticipatedNetworkVariable<List<int>>

marcusx2 avatar May 12 '25 14:05 marcusx2

What version of Netcode for GameObjects and Unity are you using?

EmandM avatar May 14 '25 21:05 EmandM

This issue has been automatically marked as stale because it has been awaiting response for over 30 days without any activity. Please update the issue with any new information or it may be closed in 30 days.

github-actions[bot] avatar Jun 19 '25 00:06 github-actions[bot]

This issue has been automatically closed because it has been stale for 30 days without any activity. Feel free to reopen if you have new information to add.

github-actions[bot] avatar Jul 19 '25 00:07 github-actions[bot]