#Error when deleting a network object inside a network object (4.5.6R pro)

12 messages · Page 1 of 1 (latest)

last eagle
#

Every time I go to another scene or delete the parent network object I get this error as my times as there are network objects as children. I believe it is a bug. Thank you.

FishNet.Object.NetworkObject.OnDestroy () (at Assets/FishNet/Runtime/Object/NetworkObject.cs:519)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()```
olive basin
last eagle
#

Ok, thats good to know. Thanks

mighty knoll
last eagle
#

Yeah for sure, I threw this simple script together that gives me the error:

#
using FishNet.Object;
using UnityEngine;

public class TempFishnetTesting : NetworkBehaviour
{
    public GameObject ParentPrefab; //empty with network obj component
    public GameObject ChildPrefab; //different empty with network obj component
    
    private GameObject _spawnedParent;
    private GameObject _spawnedChild;
    
    public override void OnStartServer()
    {
        _spawnedParent = Instantiate(ParentPrefab);
        Spawn(_spawnedParent);
        
        _spawnedChild = Instantiate(ChildPrefab);
        _spawnedChild.GetComponent<NetworkObject>().SetParent(_spawnedParent.GetComponent<NetworkObject>());
        Spawn(_spawnedChild);

        StartCoroutine(Next());
    }

    private IEnumerator Next()
    {
        yield return new WaitForSeconds(5f);
        
        Destroy(_spawnedParent);
    }
}```
last eagle
mighty knoll
#

What is the prefab setup to make this happen?

#

Have a screen capture?

last eagle
mighty knoll
#

hmm okay.

#

I think I can replicate it with that, ty.