Commit 23eab5d
authored
fix: In-Scene Placed Object Parenting, Serialization Order, and Transform Parent Detection (#3387)
This resolves issues with in-scene placed NetworkObject parenting where
the original parent has changed. This resolves the issue where loading a
scene would not order the serialization of loaded in-scene placed
NetworkObjects based on their parent-child hierarchy.
This also resolves an issue where a `NetworkTransform` would think it
was parented if nested under anything as well as removes the spamming
error message when parenting a `NetworkObject` with `NetworkTransform`
and using local space for synchronization (can be handled in
documentation as to why this is a bad idea but there may be edge cases
where a user might want to do this anyway).
[MTT-11883](https://jira.unity3d.com/browse/MTT-11883)
<!-- Add RFC link here if applicable. -->
## Changelog
- Fixed: Issue where in-scene placed `NetworkObjects` could fail to
synchronize its transform properly (especially without a
`NetworkTransform`) if their parenting changes from the default when the
scene is loaded and if the same scene remains loaded between network
sessions while the parenting is completely different from the original
hierarchy.
- Changed: The scene loading event serialization order for in-scene
placed `NetworkObject`s to be based on their parent-child hierarchy.
- Changed: Removing the error message when a `NetworkObject` with
`NetworkTransform` is parented and placed in local space when using
rigidbody for motion.
## Testing and Documentation
- Includes no additional tests (_requires manual testing due to scene
loading constraints_).
- No documentation changes or additions were necessary.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->1 parent 23412a0 commit 23eab5d
File tree
5 files changed
+107
-68
lines changed- com.unity.netcode.gameobjects
- Runtime
- Components
- Core
- SceneManagement
- Spawning
5 files changed
+107
-68
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2074 | 2074 | | |
2075 | 2075 | | |
2076 | 2076 | | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | | - | |
2084 | 2077 | | |
2085 | 2078 | | |
2086 | 2079 | | |
| |||
3543 | 3536 | | |
3544 | 3537 | | |
3545 | 3538 | | |
3546 | | - | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
3547 | 3543 | | |
3548 | 3544 | | |
3549 | 3545 | | |
| |||
Lines changed: 55 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 313 | + | |
317 | 314 | | |
318 | | - | |
319 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
| |||
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
338 | 359 | | |
339 | 360 | | |
340 | 361 | | |
| |||
2295 | 2316 | | |
2296 | 2317 | | |
2297 | 2318 | | |
2298 | | - | |
| 2319 | + | |
2299 | 2320 | | |
2300 | 2321 | | |
2301 | 2322 | | |
| |||
2368 | 2389 | | |
2369 | 2390 | | |
2370 | 2391 | | |
2371 | | - | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
2372 | 2396 | | |
2373 | 2397 | | |
2374 | 2398 | | |
| |||
2393 | 2417 | | |
2394 | 2418 | | |
2395 | 2419 | | |
2396 | | - | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
2397 | 2424 | | |
2398 | 2425 | | |
2399 | 2426 | | |
| |||
3030 | 3057 | | |
3031 | 3058 | | |
3032 | 3059 | | |
| 3060 | + | |
| 3061 | + | |
3033 | 3062 | | |
3034 | 3063 | | |
3035 | 3064 | | |
| |||
3046 | 3075 | | |
3047 | 3076 | | |
3048 | 3077 | | |
3049 | | - | |
3050 | | - | |
3051 | | - | |
| 3078 | + | |
| 3079 | + | |
3052 | 3080 | | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | | - | |
3060 | | - | |
3061 | | - | |
| 3081 | + | |
3062 | 3082 | | |
3063 | | - | |
3064 | | - | |
3065 | | - | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
| 3083 | + | |
3072 | 3084 | | |
3073 | | - | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
3074 | 3088 | | |
3075 | 3089 | | |
3076 | 3090 | | |
| |||
3083 | 3097 | | |
3084 | 3098 | | |
3085 | 3099 | | |
3086 | | - | |
3087 | | - | |
3088 | | - | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | 3100 | | |
3093 | 3101 | | |
3094 | 3102 | | |
| |||
3166 | 3174 | | |
3167 | 3175 | | |
3168 | 3176 | | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
3169 | 3186 | | |
3170 | 3187 | | |
3171 | 3188 | | |
| |||
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
332 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
333 | 340 | | |
334 | 341 | | |
335 | 342 | | |
| |||
671 | 678 | | |
672 | 679 | | |
673 | 680 | | |
| 681 | + | |
| 682 | + | |
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
677 | 686 | | |
678 | 687 | | |
679 | 688 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
| 689 | + | |
684 | 690 | | |
685 | 691 | | |
686 | 692 | | |
687 | 693 | | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
688 | 706 | | |
689 | 707 | | |
690 | 708 | | |
| |||
Lines changed: 24 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
887 | | - | |
888 | 887 | | |
889 | 888 | | |
890 | 889 | | |
| |||
917 | 916 | | |
918 | 917 | | |
919 | 918 | | |
920 | | - | |
921 | 919 | | |
922 | 920 | | |
923 | 921 | | |
924 | 922 | | |
925 | | - | |
926 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
938 | 936 | | |
939 | | - | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
940 | 949 | | |
941 | 950 | | |
942 | 951 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
| 952 | + | |
| 953 | + | |
947 | 954 | | |
948 | 955 | | |
949 | 956 | | |
| |||
986 | 993 | | |
987 | 994 | | |
988 | 995 | | |
989 | | - | |
990 | 996 | | |
991 | 997 | | |
992 | 998 | | |
| |||
0 commit comments