Title: Client NetworkObjects experience Awake, Start, OnEnable, and TriggerEnter, CollisionEnter at world 0,0,0 upon instantiation · Issue #3553 · Unity-Technologies/com.unity.netcode.gameobjects · GitHub
Open Graph Title: Client NetworkObjects experience Awake, Start, OnEnable, and TriggerEnter, CollisionEnter at world 0,0,0 upon instantiation · Issue #3553 · Unity-Technologies/com.unity.netcode.gameobjects
X Title: Client NetworkObjects experience Awake, Start, OnEnable, and TriggerEnter, CollisionEnter at world 0,0,0 upon instantiation · Issue #3553 · Unity-Technologies/com.unity.netcode.gameobjects
Description: Description When a client spawns a NetworkObject via NetworkSpawnManage.InstantiateNetworkPrefab() there is no position or rotation data passed into UnityEngine.Object.Instantiate() and therefore the object is created at world 0,0,0. On ...
Open Graph Description: Description When a client spawns a NetworkObject via NetworkSpawnManage.InstantiateNetworkPrefab() there is no position or rotation data passed into UnityEngine.Object.Instantiate() and therefore t...
X Description: Description When a client spawns a NetworkObject via NetworkSpawnManage.InstantiateNetworkPrefab() there is no position or rotation data passed into UnityEngine.Object.Instantiate() and therefore t...
Opengraph URL: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/3553
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Client NetworkObjects experience Awake, Start, OnEnable, and TriggerEnter, CollisionEnter at world 0,0,0 upon instantiation","articleBody":"### Description\n\nWhen a client spawns a `NetworkObject` via `NetworkSpawnManage.InstantiateNetworkPrefab()` there is no position or rotation data passed into `UnityEngine.Object.Instantiate()` and therefore the object is created at world 0,0,0. On a later line of code the position and rotation are assigned, _after_ instantiation.\n\nThis means `Awake`, `Start`, and `OnEnable` are all called when at world 0,0,0 -- this is arguably expected and why you have `OnNetworkSpawn`.\n\nHowever, `OnTriggerEnter` (and probably `OnCollisionEnter`) **_also_** fire for things at world 0,0,0. That problem is outside of the scope of the `OnNetworkSpawn` warmup in my opinion.\n\nDevelopers should not have to write custom code to handle this problem when the position and rotation could simply be passed into the instantiation.\n\n```\ninternal NetworkObject InstantiateNetworkPrefab(GameObject networkPrefab, uint prefabGlobalObjectIdHash, Vector3? position, Quaternion? rotation)\n{\n Vector3 defaultPosition = position ?? Vector3.zero;\n Quaternion defaultRotation = rotation ?? Quaternion.identity;\n var networkObject = UnityEngine.Object.Instantiate(networkPrefab, defaultPosition, defaultRotation).GetComponent\u003cNetworkObject>();\n // networkObject.transform.position = position ?? networkObject.transform.position;\n // networkObject.transform.rotation = rotation ?? networkObject.transform.rotation;\n networkObject.NetworkManagerOwner = NetworkManager;\n networkObject.PrefabGlobalObjectIdHash = prefabGlobalObjectIdHash;\n return networkObject;\n}\n```\n\n### Environment\n\n- OS: Windows 11\n- Unity Version: 6000.1.3f1\n- Netcode Version: 2.4.2\n- Netcode Topology: Client-Server","author":{"url":"https://github.com/zachstronaut","@type":"Person","name":"zachstronaut"},"datePublished":"2025-07-17T16:53:57Z","url":"https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/3553"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:87e65201-ecce-55bf-344d-b8bec8e5bdda |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E1C:3EE843:2B3AE7F:3B496FC:6B005D54 |
| html-safe-nonce | 2744f58fd22d3e56b96a46e5cbeab88a278c5cdd866440227c589addf9b3575d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTFDOjNFRTg0MzoyQjNBRTdGOjNCNDk2RkM6NkIwMDVENTQiLCJ2aXNpdG9yX2lkIjoiODg1Mjg2MDAxMDQ4MTM0MzgyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6770f86a9fcdb94deae6bbd5d71bc40a3079c2ffa4cff902dc80fc6d53f9c9d7 |
| hovercard-subject-tag | issue:3240262686 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Unity-Technologies/com.unity.netcode.gameobjects/3553/issue_layout |
| twitter:image | https://opengraph.githubassets.com/faae97eccfe5467eae0647042e99bc24c69bfe068ff967d92890213f22aeaa18/Unity-Technologies/com.unity.netcode.gameobjects/issues/3553 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/faae97eccfe5467eae0647042e99bc24c69bfe068ff967d92890213f22aeaa18/Unity-Technologies/com.unity.netcode.gameobjects/issues/3553 |
| og:image:alt | Description When a client spawns a NetworkObject via NetworkSpawnManage.InstantiateNetworkPrefab() there is no position or rotation data passed into UnityEngine.Object.Instantiate() and therefore t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zachstronaut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/Unity-Technologies/com.unity.netcode.gameobjects git https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git |
| octolytics-dimension-user_id | 426196 |
| octolytics-dimension-user_login | Unity-Technologies |
| octolytics-dimension-repository_id | 116385203 |
| octolytics-dimension-repository_nwo | Unity-Technologies/com.unity.netcode.gameobjects |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 116385203 |
| octolytics-dimension-repository_network_root_nwo | Unity-Technologies/com.unity.netcode.gameobjects |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width