I am trying to reparent the player into a networkObject’s child (a car seat for instance).
I am doing this by raytracing from the player to the vehicle, and activate a “take control” script on the vehicle, which turns on and off stuff.
Now in order to actually do the reparenting I need to do this on the server, so in the vehicle’s “take control” script I activate a ServerRpc to handle the reparenting with the client’s local networkId.
I get an Error saying only the owner can send an ServerRpc with reparenting. What is happening here? I tried to move the reparenting ServerRpc and call to the method into the player’s “interact” script, but the same issue comes up.
I don’t have any of the code on this machine, but hopefully this is enough to get a general guide and workflow on how to approach this. If not I’ll update this with the relevant code.
Some notes:
At this moment, the networkObject I’m trying to reparent TO is already in the scene from start, and not spawned in after server start. I don’t know if this can cause an issue regarding networkObjectId or spawnedObjectsList?
I’ll post the error and relevant code when I get home from work.
I contemplated doing that, but avoided it due to believing it’s bad practice. I may try this when I get home.
Bonus question: I see that someone reparents by calling ServerRpc, which gets the networkObject’s networkId, then trigger the reparenting on ClientRpc. I haven’t tried this, but wouldn’t that also throw the error for only server being able to reparent?