Network Object Functions

Sometimes it is useful to know the parent Actor of a replica or vice versa.

For example, by firing a projectile at a target and then calling the OnHit RPC function on the target, a function will be called on the target for all clients. However, some information is needed to know who fired the projectile.

Strix provides a network object ID that is unique to network objects. This ID is the same for an Actor and all its replicas, regardless of what client they are instantiated on. In the above example, the ID can be retrieved and sent with the RPC to get a reference to the firing Actor.

Get Network Id From Object

The Get Network Id From Object function takes an Actor reference and finds its network object ID. If the Actor doesn’t have a network object (e.g., it is not synced with the server) this function will return -1.

Get Object From Network Id

The Get Object From Network Id function takes a network ID as given by the above function and returns the Actor that has this ID. Returns null if the Actor is not found.