Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects
`NetworkObject` `CheckObjectVisibility` doesn't work on client connection
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 2.3k
- Forks
- 461
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 20
Descripción
Description
I want to spawn a networkprefab without any client visibility, first i tried to set no observers before spawn:
NetworkObject.SpawnWithObservers = false;
NetworkObject.Spawn();
this results a spawned object with zero observers, but when a late-join client connects, the object gets spawned on client. The documentation says this is the intended normal behavior, because it only works at the initial spawning.
Then, the documentation says the CheckObjectVisibility will work at both initial spawning and new client connection, so i tried this:
NetworkObject.CheckObjectVisibility += _ => false;
NetworkObject.Spawn();
it did spawn with no observers as the previous approach, but when late-join client connects, it still spawn the object on client.
Reproduce Steps
- start server/host
- spawn a network prefab with
NetworkObject.CheckObjectVisibility += _ => false; - start a client and connect to server
Actual Outcome
a spawned object with visibility always set to false still spawns on late-join client
Expected Outcome
a spawned object with visibility always set to false should be invisible to all connected client and future late-join clients
Environment
- OS: [win10]
- Unity Version: [6000.0.32f1]
- Netcode Version: [2.1.1]
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el comportamiento de NetworkObject en SpawnWithObservers, Spawn y CheckObjectVisibility, comparando la documentación sobre spawning y visibilidad de objetos enlazada en el informe. Reproduce la secuencia de late join con CheckObjectVisibility devolviendo false y confirma que el objeto permanece ausente en el cliente; se considera terminado cuando la visibilidad también se aplica a futuros clientes que hagan late join.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, unity
- Área
- game-dev, networking
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100