Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Client in the objectCreated handler, getting a null AttachedBehavior #371

@Gwom

Description

@Gwom

Version Number and Operating System(s):

03/10/2018-19.53.38,04 Windows, Unity Editor 2019.2.21f1

Expected behavior:

objectCreated should be called after the AttachedBehaviour's GameObject is Setup / Passed Start() / NetworkStart(), if not, add a callback that is at this point and rename ObjectCreated - it may just be me but I assumed this should be done by the time this is called, maybe it is a naming issue. Even more ideal would be to have something in the objectCreated callback where you could access the GO without having to typecast as this would be useful!

Actual behavior:

For the Client, I found NetworkStart is called after the objectCreated callback, leading to the AttachedBehaviour to be null.

Steps to reproduce:

  • Attach a Host, Make a NetworkObject (e.g. NO with Behaviour NOBehaviour)
  • Add Debug to the NOBehaviour NetworkStart method if(NetworkBehaviour is NOBehaviour) that outputs the AttachedBehaviour to Debug
  • Setup callback for objectCreated on Client
  • Attach a Client
  • In the callback, using MainThread the if(NetworkBehaviour is NOBehaviour) passes but the AttachedBahaviour is null.
  • Note, the Debug in the NOBehaviour NetworkStart is called after
  • (sorry for all the bugs)

[Optional] Discord Username:

Gwom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions