Add Flag "IncludeNested" on SetLocalOwnership() and GiveOwnership() methods #732
Replies: 3 comments
-
I'll be adding this in 4.4.0. A heads up, the default value will have to be whatever current behavior is. |
Beta Was this translation helpful? Give feedback.
-
I see that Give/Remove is false to including nested, while PredictedOwner seemed to have defaulted to true. I'll probably need to add a break to default PredictedOwner to false as well; they shouldn't be different as that just creates a lot of confusion. |
Beta Was this translation helpful? Give feedback.
-
Added in 4.4.0. The original PredictedOwner.TakeOwnership uses TRUE as includeNested, but the method has been obsoleted. There is now an overload containing includeNested. |
Beta Was this translation helpful? Give feedback.
-
Right now the
SetLocalOwnership
method will set the ownership of the given object and will include all of the nested network objects, whileGiveOwnership
will only set the ownership for the root object.In a scenario where you call
SetLocalOwnership
on the local machine and then send an rpc to the server so that it willGiveOwnership
to the same connection you will have a disparity in the ownership between server and client.I think that the best solution is to have the option to include/not include the nested objects in both methods. To make sure that it won't break any code using the current version you could add the flag with default to
false
onGiveOwnership
andtrue
onSetLocalOwnership
, or create overloads.Beta Was this translation helpful? Give feedback.
All reactions