feat: NetworkTransforms throughout project optimized where possible [MTT-6312] by fernando-cortez · Pull Request #836 · Unity-Technologies/com.unity.multiplayer.samples.coop
Description
This PR upgrades NetworkTransforms inside the project to reduce bandwidth cost.
Prefabs/ scene objects that had Synchronize Transform enabled inside their NetworkObject component that didn't need to synchronize position have now that flag disabled. This is particularly useful if the NetworkObject is used more for management related tasks and has no spatial synchronization needs. This will reduce initial synchronization payloads.
CharacterPrefab prefab which all PCs & NPCs derive from now have on their NetworkTransform:
- sync only x and z positions
- sync only z rotation
- have half float precision enabled
The savings as seen from a client are as follows:
Only syncing x and z positions explicitly:

Only syncing x and z positions, y rotation, and half float precision enabled:

Only syncinc x and z positions, half float precision enabled, quat syncing and quat compression enabled:

Bandwidth costs considered, since only the y position is modified per frame in a worst case scenario, it is more cost efficient to only: sync x and z positions, y rotation, and enable half float precision. Individual NetworkTransform packet sizes are reduced from 21 bytes down to 16 bytes with this optimization.
Issue Number(s)
Contribution checklist
- Tests have been added for boss room and/or utilities pack
- Release notes have been added to the project changelog file and/or package changelog file
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- JIRA ticket ID is in the PR title or at least one commit message
- Include the ticket ID number within the body message of the PR to create a hyperlink
- An Index entry has been added in readme.md if applicable
