Add Support for Nested NetworkObjects in Prefabs
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
- #2645 di @Clicky02 — chiusa senza merge
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- game-dev, networking
Direzione di ricerca
Non sono indicati file o test. Inizia tracciando come vengono generati i prefabs e i NetworkObjects, quindi determina come verrebbero registrati e posseduti gli oggetti figlio annidati; il lavoro è completato quando la generazione di un prefab mette automaticamente in rete i suoi NetworkObjects annidati, preservando il parenting e una proprietà separata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
One major pain point of using Unity Netcode for GameObjects (as well as many other networking solutions) is the lack of support for spawning nested NetworkObjects. Currently, if you try to spawn a prefab with nested NetworkObjects, the primary NetworkObject will be networked, while all the child NetworkObjects will not.
As an example, imagine that you are trying to spawn a boat with cannons that each player can move and shoot. In this scenario, it would make sense that (1) cannons should be parented to the boat and (2) any player should be able to take ownership of a cannon (separate of the boat) when they go to move/shoot it. This means that both the boat and the cannons would need to be NetworkObjects. However, because of this limitation, you would not be able to make one boat prefab with the cannons on it.
Describe the solution you'd like
Ideally, when a prefab with nested NetworkObjects is spawned, it should automatically network any child network objects.
Describe alternatives you've considered
You can work around the issues with nested NetworkObjects, but it requires designing your prefabs/scripts in less intuitive ways.
For instance, in the boat example I mentioned earlier, you could create cannon spawners that spawn the cannons separately when the boat is spawned. However, this has its own issues. Primarily:
- It is harder to position the cannons.
- If you just try to position the cannons with the transform of the spawner, it will be difficult to visualize the final product.
- Positioning the cannon prefab first and then replacing it with the spawner requires more work than necessary. Also, what if the boat model changes and you need to reposition the cannons? You'll have to add back in the cannon prefab, position it, move the spawner to that position, and delete the cannon prefab.
- In Editor, scripts on the boat cannot reference scripts on the cannons (and vice versa).
- This means you may have to wire up scripts at runtime.
- This also means that your code will have to check to make sure that the cannons have been spawned in before doing anything with them, since they aren't necessarily spawned at the same time as the boat.
There are other solutions to these types of problems, but they are generally more difficult to implement and/or encourage poor design.
Additional context
N/A
- Lingua principale
- C#
- Stelle
- 2.3k
- Fork
- 465
- Merge medio
- 3g 12h
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Unity-Technologies/com.unity.netcode.gameobjects
-
TimeSyncMessage is sent reliably, so a late one resets the client clock backwards and stalls its NetworkTransformsForse già presa @reginaldalfret l’ha presa 8 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Unity-Technologies/com.unity.netcode.gameobjects#4249 ·
I maintainer di solito rispondono entro 3 giorni
-
NetworkTransform: half-float base update dropped as out of order when UseUnreliableDeltas is on, so later deltas decode ~2 m offForse già presa @NoelStephensUnity l’ha presa 8 giorni fa. Apertaport:3.x-completed priority:medium stat:imported type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
Unity-Technologies/com.unity.netcode.gameobjects#4248 ·
I maintainer di solito rispondono entro 3 giorni
-
Tracking type:feature-2.x
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Tracking type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
priority:medium stat:imported type:feature type:feature-2.x
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Unity-Technologies/com.unity.netcode.gameobjects#3706 · 5 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di Unity-Technologies/com.unity.netcode.gameobjects
Issue simili
-
hand-to-AI
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
DXF with empty names failsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
bug python
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
I maintainer di solito rispondono entro 13 giorni