Skip to content

AnticipatedNetworkVariable using Anticipate on server fails #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marcusx2 opened this issue May 9, 2025 · 3 comments
Open

AnticipatedNetworkVariable using Anticipate on server fails #3442

marcusx2 opened this issue May 9, 2025 · 3 comments
Labels
stat:awaiting-response Awaiting response from author. This label should be added manually. type:bug Bug Report

Comments

@marcusx2
Copy link

marcusx2 commented May 9, 2025

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 marcusx2 added type:bug Bug Report stat:awaiting-triage Status - Awaiting triage from the Netcode team. stat:reply-needed Awaiting reply from Unity account labels May 9, 2025
@EmandM
Copy link
Collaborator

EmandM commented May 12, 2025

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?

@github-actions github-actions bot added stat:awaiting-response Awaiting response from author. This label should be added manually. and removed stat:reply-needed Awaiting reply from Unity account labels May 12, 2025
@marcusx2
Copy link
Author

marcusx2 commented May 12, 2025

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>>

@github-actions github-actions bot added stat:reply-needed Awaiting reply from Unity account and removed stat:awaiting-response Awaiting response from author. This label should be added manually. labels May 12, 2025
@EmandM
Copy link
Collaborator

EmandM commented May 14, 2025

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

@github-actions github-actions bot added stat:awaiting-response Awaiting response from author. This label should be added manually. and removed stat:reply-needed Awaiting reply from Unity account labels May 14, 2025
@michalChrobot michalChrobot removed the stat:awaiting-triage Status - Awaiting triage from the Netcode team. label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting-response Awaiting response from author. This label should be added manually. type:bug Bug Report
Projects
None yet
Development

No branches or pull requests

3 participants