I have NPC (contain a Humanoid) pets that a player (or multiple) is able to ride, such as a Dragon, with a rider and passenger seat.
So after reading the Dev page on Network Ownership, I am still not sure which part to assign to the driver player.
Since the Pet uses a Humanoid, the primary rider controls the pet ‘vehicle’ by reading the rider’s Humanoid MoveDirection and assigning it to the pet’s Humanoid.
So since its a Humanoid thing, which part should have network ownership given the the rider?
I believe to give the rider (the one who controls it) optimal control you’d have to set all parts of the pet to their ownership. By handing their client control of the entire creature it can determine its location in 3d space fully and in the most immediate way. You will need to take into account that this can be abused so a server-sided check for distance travelled (taking into account a margin for difference in ping) may be in order.
I initially thought the same thing, however on the Dev page for it, they use an example of a vehicle with a Vehicle Seat, and a normal Seat.
In the example, the Vehicle Seat was used for controlling the vehicle, and in the source code, they only set the Vehicle Seat’s network ownership to the player sitting in it, not the whole vehicle object.
So from that I assume you only need to set the ‘controlling’ basepart’s network ownership.
So if that is true (and its just an assumption on my part based on the example) I would think I need to set ownership of the Humanoid’s controlling BasePart, and so I’m guessing HumanoidRootPart? I really wish the Dev Page would give some better explaination and maybe more diverse examples of how to do this.
I did try, and (testing in studio with a server and two players) I can’t really see any difference. I’m not sure if its just not working or I’m doing it wrong, or if on a local system, its just not enough latency to make a difference.
So no, sometimes to just ‘try and see’ doesn’t always give the ‘most conclusive answer’ (at least not in this case)
From what I can tell, even if I call SetNetworkOwner (from the server) to a player (the rider), still when the passenger gets on its setting the network owner to be the passenger.
So, not sure why SetNetworkOwner isn’t ‘sticking’.