Skip to content

Specify GlobalObjectIdHash at runtime (for procedurally generated prefabs) #1360

@ghost

Description

Is your feature request related to a problem? Please describe.
I would like to generate prefabs procedurally at runtime.
I can easily register them with NetworkManager.PrefabHandler.AddHandler.
The only missing part is that I can't set NetworkObject.GlobalObjectIdHash because it's internal.

Describe the solution you'd like
I understand exposing NetworkObject.GlobalObjectIdHash might be a problem (it's advanced use case and if public on NetworkObject, user might think it's OK to edit it in typical scenario).
Maybe adding it in a more specific location such as a method in NetworkPrefabHandler would be very helpful.

Describe alternatives you've considered
Currently I use reflection to set it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature, request or improvement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions