Search Issue Tracker

Fixed

Fixed in 1.2.0

Votes

0

Found in [Package]

1.2.0

Issue ID

N4EBUG-42

Regression

Yes

GhostAuthoringInspectionComponent is invalid on additional entities created from children

Package: Unity Netcode

-

Context: [https://unity.slack.com/archives/C0214P2C947/p1696623271668409]

With thanks to [~philippe.stamand] for the find!

 

*Repro*
# Create a ghost with children.
# Have those children spawn additional entities.
# Have a code-based default variant with SendDataForChildEntity = false.
# Observe how the additional children default to replicating.
# Also observe how attempting to manually fix the children results in the exception:

{code:java}
GetOrAddPrefabOverride:

if (gameObject.GetInstanceID() != entityGuid.OriginatingId)
{
var didMatchChild = TryGetFirstMatchingGameObjectInChildren(gameObject.transform, entityGuid, out var childGameObject);
var error = didMatchChild ? $"It matches a child instead ({childGameObject}). Overrides MUST be added to the Inspection component of the GameObject you are modifying!" : "Unknown GameObject.";
throw new ArgumentException($"Attempting to GetOrAddPrefabOverride for entityGuid '{entityGuid}' to '{this}', but entityGuid does not match our gameObject! {error}");
}{code}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.