Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Fixed

- Fixed issue where a `NetworkTransform` component placed on the child of the `NetworkObject` component failed to render the inspector. (#4261)
- Issue where every `NetworkObject` that started before a session logged a "Did not register because there is no session in progress!" warning when `NetworkManager.LogLevel` was `Developer`. Only `GhostObject` instances log it now. (#4245)
- Fixed a NullReferenceException that would be thrown if a MonoBehaviour derived from NetworkManager defines it's own Awake or OnEnable. (#4244)
- Issue where the unified bootstrap created a second world that ran a duplicate of every default system next to the default world. (#4243)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void OnEnable()
private void SetGUIActive(bool active = true)
{
#if UNIFIED_NETCODE
if (Application.IsPlaying(m_NetworkObject) && m_NetworkObject.HasGhost)
if (m_NetworkObject != null && m_NetworkObject.HasGhost && Application.IsPlaying(m_NetworkObject))
{
GUI.enabled = false;
}
Expand All @@ -122,8 +122,9 @@ private void DisplayNetworkTransformProperties()
var networkTransform = target as NetworkTransform;

#if UNIFIED_NETCODE
m_NetworkObject = networkTransform.GetComponent<NetworkObject>();
var hasGhost = m_NetworkObject.HasGhost;
// NetworkBehaviours can be nested anywhere beneath their NetworkObject
m_NetworkObject = networkTransform.NetworkObject;
var hasGhost = m_NetworkObject != null && m_NetworkObject.HasGhost;
SetGUIActive();
#else
#if COM_UNITY_MODULES_PHYSICS || COM_UNITY_MODULES_PHYSICS2D
Expand Down Expand Up @@ -333,7 +334,7 @@ private void DisplayNetworkTransformProperties()

#if COM_UNITY_MODULES_PHYSICS
// if rigidbody is present but network rigidbody is not present
if (hasGhost && networkTransform.TryGetComponent<Rigidbody>(out _) && networkTransform.TryGetComponent<NetworkRigidbody>(out _) == false)
if (!hasGhost && networkTransform.TryGetComponent<Rigidbody>(out _) && networkTransform.TryGetComponent<NetworkRigidbody>(out _) == false)
{
EditorGUILayout.HelpBox("This GameObject contains a Rigidbody but no NetworkRigidbody.\n " +
"Add a NetworkRigidbody component to improve Rigidbody synchronization.", MessageType.Warning);
Expand Down
Loading