Closed Nyphur closed 1 month ago
@Nyphur I believe this issue was resolved in PR-2968. The most recent version of NGO (v1.10.0) should contain this fix.
Let me know if this resolves your issue?
Thanks, that does seem like it may solve the issue in that version. Unfortunately it doesn't work for most ongoing projects as 1.10 is targeting Unity 6.0+ and later, will have to just use a workaround.
@Nyphur NGO v1.x versions target 2022.3 and Unity 6. You should be able to use NGO v1.10.0 on 2022.3.
The NetworkSpawnManager.InstantiateAndSpawn method takes in a bool isPlayerObject, but the spawn code overwrites this to false every time.
You can see here that it sets IsPlayerObject based on the supplied variable and then calls SpawnWithOwnership which calls SpawnInternal: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/440039027311ff10b900480884b64a574d9b3028/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs#L412
And here you can see that SpawnInternal just automatically passes in false as the isPlayerObject: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/440039027311ff10b900480884b64a574d9b3028/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs#L873