Some trouble with replication

I have some problems with replicating tank control using the crew’s reference to this very tank. While everything works fine for the server, the clients can’t manage the tank. At the same time, clients seem to have a reference



If you have made control via inputs in the tank (or if you try to call RPC events that are in the tank), then the client must become the owner of the tank on the server so that he can send RPC events for control to the server.

Is there a similar message in the log by any chance?

But what we are trying to achieve here gameplay wise? like server can control other client tanks or ?

Yeah I have this one. Tell me, can a pawn have multiple owners? If so, can I find out how I can grant the owner to the player?

An actor can have only one owner (or none at all (default)). This is necessary to determine which client should receive Client RPCs, and also whether a given client can send its RPCs to the server.
Becoming an owner is very simple - call the SetOwner function ON THE SERVER and specify the client player controller (or character, or another actor that the client already owns) as the new owner.

To simulate multiple ownership I use a method I call RPC Tunnel - for each client I create an actor that it owns, and through this actor I call events in the common actor. I think you should do the same.

thank you very much, but can you please explain in a little more detail how this method works? I would be very grateful.

Something like this:


image
image

And so Tunnel-actor is an onwer of common actor, right? You know what, forget it, I’ll figure it out myself. I’ve already taken up a lot of your time. Thank you very much again

Well I try this, but I got the same result with the fact that only the server can manage. most likely, I made a mistake somewhere, because I had to change your blueprint a lot so that it could work correctly in my project.

For clarity are you trying to create a tank in which multiple clients control specific aspects of?

Best approach for this is to spawn the tank (primary actor), then spawn the other controllable components, attach them and possess each appropriately.

This will give the clients direct control (ownership) of the possessed component vs tunneling RPC/events all over the place.

as @Rev0verDrive was asking, maybe if you can specify too what actually we are trying to achieve here, it will be helpful like whether it’s a tank actor which is spawned and have to be controlled by clients or tanks are AI which do their work of random movement and shooting or like that?