NetIdentityComponent struct in Thread
Marks an entity as part of the shared world in a multiplayer game. It exists on every player's machine under the same uuid. One machine owns it and simulates it; the others show a copy that follows. See Multiplayer (co-op).
Properties
| ReplicateTransform | bool | The owner sends position and rotation ~20 times a second; copies interpolate ~100 ms behind. Default true. |
| ScriptsOnOwnerOnly | bool | This entity's scripts (and its children's) run only on the owner's machine. Default true. Turn off for a player whose stats the host keeps, or for scripts that only draw. |
| Owner | uint8_t | Runtime, not saved. The owner's player id: 0 (the host) for everything authored, the player's id for their own character. |
| SpawnedFrom | std::string | Runtime, not saved. The prefab it was spawned from; empty for an entity authored in the scene. |
On a copy
- Rigid bodies are kinematic and follow the replicated transform.
- A character controller is not simulated; its inner body stays on the character, so raycasts and triggers still see it.
- Cameras are switched off, so the scene renders through your own character's camera.
- Behaviour trees and navigation do not run.
When there is no session, none of this applies: everything is local.
NetIdentityComponent struct w Thread
Oznacza encję jako część wspólnego świata w grze wieloosobowej. Istnieje na komputerze każdego gracza pod tym samym UUID. Jeden komputer jest jej właścicielem i ją symuluje, a pozostałe pokazują kopię, która za nim podąża. Zobacz Multiplayer (co-op).
Właściwości
| ReplicateTransform | bool | Właściciel wysyła pozycję i obrót ok. 20 razy na sekundę, a kopie interpolują ok. 100 ms wstecz. Domyślnie true. |
| ScriptsOnOwnerOnly | bool | Skrypty tej encji (i jej dzieci) działają tylko na komputerze właściciela. Domyślnie true. Wyłącz dla gracza, którego statystyki trzyma host, albo dla skryptów, które tylko coś rysują. |
| Owner | uint8_t | W czasie działania, nie zapisywane. Numer gracza-właściciela: 0 (host) dla wszystkiego, co jest w scenie, numer gracza dla jego własnej postaci. |
| SpawnedFrom | std::string | W czasie działania, nie zapisywane. Prefab, z którego encję zespawnowano; puste dla encji wstawionej w scenie. |
Na kopii
- Ciała sztywne są kinematyczne i podążają za replikowanym transformem.
- Kontroler postaci nie jest symulowany; jego wewnętrzne ciało zostaje na postaci, więc raycasty i triggery nadal ją widzą.
- Kamery są wyłączone, więc scena renderuje się z kamery twojej postaci.
- Drzewa zachowań i nawigacja nie działają.
Bez sesji nic z tego nie obowiązuje: wszystko jest lokalne.