Skip to content

Allow serialization of NetworkBehaviour references #906

@sk3p71c

Description

@sk3p71c

Is your feature request related to a problem? Please describe.
RPC calls give a mechanism to resolve component references across the network. However, they only do so for one component at a time (the caller). It would be useful to allow references to components to be resolved more generally. Example: I wanted to create a general-purpose server-side transaction that transferred a resource from one component to another and could be invoked on a client. Because the transaction involved two components, a standard RPC was insufficient.

Describe the solution you'd like
Ideally, allow references to NetworkBehaviours to be serialized. The approach would be the same as is currently used under the hood to locate corresponding NetworkBehaviours for RPC calls. That is, send the networkObjectId and networkBehaviourID; the latter being found using GetNetworkBehaviourOrderIndex.

Describe alternatives you've considered
You could instead make the GetNetworkBehaviourOrderIndex and GetNetworkBehaviourAtOrderIndex methods of NetworkObject public, which would allow a user to implement serialization themselves if desired.

Additional context
None

Thanks,
Carl

Metadata

Metadata

Assignees

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