-
Notifications
You must be signed in to change notification settings - Fork 450
fix: netvar client initialization #1266
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
fix: netvar client initialization #1266
Conversation
… correctly to clients as initialization and not delta
@@ -419,7 +419,7 @@ internal void SendSpawnCallForObject(ulong clientId, NetworkObject networkObject | |||
|
|||
var message = new CreateObjectMessage | |||
{ | |||
ObjectInfo = networkObject.GetMessageSceneObject(clientId, false) | |||
ObjectInfo = networkObject.GetMessageSceneObject(clientId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct, just wondering why it was 'false' previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also wondering that, but it definitely seems like it should be true.
|
||
namespace TestProject.RuntimeTests | ||
{ | ||
public class NetworkVariableInitializationOnNetworkSpawnTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good, I think I would suggest this could live in NetworkVariableTests. Also in that file you might see you can do the same tests a bit more concisely with the RunAndWaitForCondition helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor +1 to Matt's comment but apart from that 🚀
… correctly to clients as initialization and not delta (Unity-Technologies#1266) Co-authored-by: Matt Walsh <69258106+mattwalsh-unity@users.noreply.github.com>
Ensure server netvar initialization in OnNetworkSpawn replicates correctly to clients as initialization and not delta
MTT-1351
Changelog
com.unity.netcode.gameobjects
Testing and Documentation