JimJ
Normal12mo ago
9 replies
Jim

Best practices for requesting ownership of RealtimeView and needing to execute logic based on that

In the below pseudo code I believe there would be a bug due to the asynchronous nature of ownership requests ? I'd like to wait for the answer within a reasonable time frame

var rv = other.gameObject.GetComponent<RealtimeView>();
// Request network ownership
rv.RequestOwnershipOfSelfAndChildren();

// ownership will not be instant because of latency
if (rv.isOwnedLocallySelf )
{
// Do Stuff
}
Was this page helpful?